Red Hat Bugzilla – Bug 220264
#!/usr/bin/env python -tt doesn't work
Last modified: 2007-11-30 17:11:51 EST
Description of problem:
A file starting with '#!/usr/bin/env python -tt'
does not behave the same when executed as:
python -tt FILE
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. printf '#!/usr/bin/env python -tt\nprint 1\n' > t
2. chmod +x t
4. python -tt t
/usr/bin/env: python -tt: No such file or directory
Works on MacOS 10.4, with its FreeBSD derived /usr/bin/env
When invoking any program via #!, only two things can be on that first line: the
first (everything up to first white space byte) is taken as a program name.
Everything after that first bit of white space is grouped together as a single
"argument" to that program. In your case, "python -tt" is interpreted as a
program name, and of course is not found.
Instead, you can do something like this:
cat <<EOF > t
Thanks for the explaination.