I'm using a sendmail wrapper, but it prints only the path to the folder, not the running PHP script.
Is it possible to get the filename of the PHP script that invoked the shell script?
$(basename $(readlink -nf $0))
do not work. It shows me the "sendmail" filename.
You can probably try to run:
ps aux | grep php
in command line and parse out the name of the file.