shebang line parsing changed in FreeBSD6
Alfred Morgan
alfred.morgan at adecn.com
Tue Jun 13 16:26:43 UTC 2006
Can someone explain to me why parsing of the shebang line changed?
...for the worse in my opinion.
I want to do this in FreeBSD6:
#!/usr/bin/env python -u
I can't do this because the shebang is evaluated as /usr/bin/env 'python
-u' which causes an error. So I read the man page for env and find this:
Note that the way the kernel parses the `#!' (first line) of an
interpreted script has changed as of FreeBSD 6.0..., the first line
should be changed to: #!/usr/bin/env -S /usr/local/bin/php -n -q
-dsafe_mode=0
I changed my shebang line by adding -S and it works fine in FreeBSD6 but
is not as portable. The -S option for env is new for FreeBSD6. This
means my code is now not portable between FreeBSD6 and other operating
systems including FreeBSD5.
I stay with FreeBSD because I like the direction, practicality, and the
people. Changes are usually made for the better but in this case I am
left with one question. Why?
-alfred
More information about the freebsd-questions
mailing list