How to get '#! /usr/bin/env python' to interpret in Python instead of Bash
I installed HPLIP, and discovered all of its Python scripts start with the shebang
#! /usr/bin/env python
But this does not work on an Unslung NSLU2, because there is no env subdirectory. I'm guessing that is usually a subdirectory listing environment variables. Python scripts starting this way try to run in Bash, and Bash doesn't know what to do with them. For Python scripts to run, the shebang line must be
Which is a symbolic link to /opt/bin/python, which is a symbolic link to /opt/bin/python2.5
I would rather not change all these scripts because there are so many of them, and it makes them different than the installed package. I have searched Google for how to fix it where the shebang line #! /usr/bin/env python will be interpreted by Python. I now vaguely understand the pros and cons of how to specify interpreters in shebang lines. The problem is the supposed advantage to using #! /usr/bin/env python doesn't work in Unslung. I haven't found anywhere it tells you how to correct this so if it doesn't work, you can make it work in your install.
Can anyone tell me how to get #! /usr/bin/env python to interpret by the Python interpreter in Unslung?
- Joel Gebhart wrote:
> Can anyone tell me how to get /#! /usr/bin/env python/ to interpret byYou need the /usr/bin/env program:
> the Python interpreter in Unslung?
ipkg install coreutils