I'm running a PHP script in a larger shell script by doing
php -f $filename > `basename $filename .php`.html
Now I would like to let the script tell me which file extension to use for the output file name. I tried
export AW_FILENAME_SUFFIX=".html"
php -f $filename > `basename $filename .php`$AW_FILENAME_SUFFIX
and a putenv("AW_FILENAME_SUFFIX=.txt") in the script itself, but it seems that only changes the environment the PHP command and its subprocesses run in, not the one of the calling script.
Is there another way to get data out of my script besides the output that I can use for metadata like that, or writing to a second file?
I will run several scripts, which AFAIK means I can't really source them into mine, that might give me duplicate function errors.