问题描述:

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 $0)

or

$(basename $(readlink -nf $0))

do not work. It shows me the "sendmail" filename.

Thanks.

网友答案:

You can probably try to run: ps aux | grep php

in command line and parse out the name of the file.

相关阅读:
Top