当前位置: 动力学知识库 > 问答 > 编程问答 >

Get the name of the running php script in bash

问题描述:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: