[Tutor] env shebang with options

David Rock david at graniteweb.com
Thu Apr 29 21:47:27 EDT 2004


* Thorsten Kampe <thorsten at thorstenkampe.de> [2004-04-30 01:13]:
> I'm trying to set up a Python script with a shebang with options:
> 
> % cat test.py
> #! /usr/bin/env python -Ot
> 
> % chmod 700 test.py; ./test.py
> /usr/bin/env: python -Ot: No such file or directory

Make sure that python is in your path. /usr/bin/env python should
resolve to an actual location. Try doing this on the commandline and
make sure you get what you think you should get:

bash-2.05b$ echo $PATH
/bin:/usr/bin:/usr/local/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.3:/usr/X11R6/bin:/opt/blackdown-jre-1.4.1/bin:/usr/qt/3/bin:/home/drock/bin

bash-2.05b$ which python
/usr/bin/python

bash-2.05b$ env python
Python 2.3.3 (#1, Jan 24 2004, 19:16:27)
[GCC 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

bash-2.05b$ export PATH=/bin

bash-2.05b$ which python
bash: which: command not found

bash-2.05b$ env python
env: python: No such file or directory

-- 
David Rock
david at graniteweb.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.python.org/pipermail/tutor/attachments/20040429/ecc7c557/attachment.bin


More information about the Tutor mailing list