Bug in #! processing - "pear broken on current"

Garance A Drosihn drosih at rpi.edu
Mon Jun 20 07:46:50 GMT 2005


At 11:08 AM +0200 6/13/05, Roman Neuhauser wrote:
># des at des.no / 2005-06-10 14:19:09 +0200:
>>  Roman Neuhauser <neuhauser at sigpipe.cz> writes:
>>  > That simply shows that all these *Linux* distros don't handle
>>  > shebang lines well.
>>
>>  Actually, it shows that they handle shebang lines *correctly*, and
>>  that we don't unilaterally break Pear by aligning ourselves with them.
>
>     These two were identical before:
>
>     #!/usr/local/bin/php -n -q -dsafe_mode=0 -doutput_buffering=1
>     % /usr/local/bin/php -n -q -dsafe_mode=0 -doutput_buffering=1
>
>     These two are identical now:
>
>     #!/usr/local/bin/php -n -q -dsafe_mode=0 -doutput_buffering=1
>     % /usr/local/bin/php "-n -q -dsafe_mode=0 -doutput_buffering=1"
>
>     Obviously, "correct" is whatever behavior we declare as such.
>     But is the latter actually useful? The Linux distros you
>     shown hacking around the shebang parsing limitations (forking
>     another shell to achieve the correct parsing) shows just that:
>     Linux distros basically avoiding anything above the simplest
>     "#!/bin/sh".

Note that there is a history behind all this, and it's due to that
history that FreeBSD's previous behavior is wrong.  And it is wrong
because it meant that some scripts which used to work on FreeBSD
cannot be made to work on other OS's, and it also meant that some
scripts that work on other OS's could not be made to work under
the previous behavior of FreeBSD's kernel.

Believe me, I've wasted a lot more hours than I would care to count
investigating this very topic in the last six months.  If there was
any way I could have justified keeping the previous FreeBSD behavior,
I would have.  I ended up breaking some of my *own* scripts when I
made that change!

But now that I've come up with these changes to `env', I'm kinda
happy about how the whole thing turned out.  Now if we could just
convince other OS's to pick up those changes!  They could do that
without breaking any of their current scripts, too.

-- 
Garance Alistair Drosehn            =   gad at gilead.netel.rpi.edu
Senior Systems Programmer           or  gad at freebsd.org
Rensselaer Polytechnic Institute    or  drosih at rpi.edu


More information about the freebsd-ports mailing list