Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jun 2006 09:26:37 -0700
From:      Alfred Morgan <alfred.morgan@adecn.com>
To:        freebsd-questions@freebsd.org
Subject:   shebang line parsing changed in FreeBSD6
Message-ID:  <448EE73D.1010606@adecn.com>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?448EE73D.1010606>