shebang line parsing changed in FreeBSD6

Alfred Morgan alfred.morgan at adecn.com
Wed Jun 14 22:20:29 UTC 2006


 > http://www.freebsd.org/cgi/query-pr.cgi?pr=16393

I see that this problem is so convoluted that the shebang line has 
different implementations on the different systems.  What about the idea 
of adding a space after #! to indicate to parse it the way freebsd did.  
The space following #! will not affect old implementations and will 
signal the new implementation in FreeBSD6 to split up the arguments.

Examples:

Note the space after the #!.
This next line would work the same in both FreeBSD5 and FreeBSD6:
#! /bin/sh -x -e

Currently in FreeBSD6 we need to use env -S to get old functionality.
This will not work in FreeBSD5 because FreeBSD5's env is missing the -S 
option:
#!/usr/bin/env -S /bin/sh -x -e


Space after #! is better than the env -S solution we have now that 
doesn't work in FreeBSD5 or below.

-alfred



More information about the freebsd-questions mailing list