Bug in #! processing - One More Time

Garance A Drosihn drosih at rpi.edu
Fri Feb 25 22:36:48 GMT 2005


At 1:03 PM -0800 2/25/05, Gordon Tetlow wrote:
>Garance A Drosihn wrote:
>  >
>  > 3) Change kern/imgact_shell.c to process shebang options the same
>>     way other (non-BSD?) operating systems do.  By that I mean:
>>     send the entire string as arg[1], and let the scripting
>>     language sort it out.  This is an incompatible change from
>>     FreeBSD 5.3 to 5.4, but would put make us "more consistent"
>  >    with other operating systems.

Additional data point: It seems that both OpenBSD and NetBSD do
it the same way the other OS's do.  Which is to say, I don't think
there is any OS which matches FreeBSD's present behavior.

>  > Or we could do #1 for now, and plan to do #4 after 5.4-release.
>>  Or do #1 now in 5.3, and go with some incompatible change (#2
>>  or #3) only in 6.x-current.
>
>I would say we should stick with #1 for the 5.x release and
>use #3 for 6.x and further. We have already frozen APIs and
>ABIs. For people that might have scripts that use this syntax
>to have problems between minor releases is unacceptable.

The more I look at this, the more I think we can do #3 without
breaking much of anything.  But I am not confident that I could
get it done and have it tested-enough in time for 5.4-release.
I need to write an update to kern/imgact_shell.c and bin/sh,
and I have to at least check what this means for /usr/bin/env
(since many scripts use that as the "interpreter" on `!#' lines).

Other than that, what else in the base system is even *used* as
an interpreter in this fashion?  Would `awk' be?  Anything else?

-- 
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-arch mailing list