开发者

Bash: not absolute script #! interpreter?

Is it possible to开发者_运维百科 say to a script to search for an interpreter not in an absolute location, but in his path?

For example, writing #!/usr/bin/php will fail if the user has php installed somewhere else.

Just writing #!php does not automatically work, of course, and I couldn't find anything about it, they just all treat this method as if it was "the way"® to do it.

So, is there a standard simple syntax to say "search for it anywhere in your path"?


Try:

#!/usr/bin/env php
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜