I need a well written and commented bash script.
The script will be called by php and must always return a streamed file on standard out.
The only complexity in the script is in the selection of the files to be used in the std out.
Deciding which files to use is based on the inputs to the file. I have a spec which explains how $1, $2, $3 etc... can be used to select files. All errors must be handled by within the script so that a file is always streamed on std out even if errors occur.
Finally, I need the file that is streamed on std out to also be written to the filesystem.
I can give more and full details to the successful bidder.