Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I just downloaded a python script and noticed that the "shebang" line at the top looks like:

#!/usr/bin/env python

instead of the familiar

#!/usr/bin/python

What's the reason for that?

share|improve this question

1 Answer 1

This is commonly used if the absolute path of the interpreter binary is not know or is assumed to be in different location from system to system. For python one could have an installation in /usr/local/ in addition to the ones installed by the distribution in /usr/. Without env in the shebang you would have to modify it to reflect your installation in /url/local/.

share|improve this answer
    
Makes sense. Thanks –  Frank Brenner Feb 15 '11 at 12:13
1  
@Frank: if that answered your question, you should accept it (meta.serverfault.com/questions/1033/…) –  Olli Feb 15 '11 at 12:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.