views:

27

answers:

1

Is it possible to say to a script to search an interpreter not in an absolute location, but in his path?

example:

Having to write #!/usr/bin/php is totally retarded: what if the user have php installed somewhere else?

Just writing #!php does not automagically works, 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"?

+5  A: 

Try:

#!/usr/bin/env php
Muhammad Alkarouri