Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Jun 2006 15:20:23 -0700
From:      Alfred Morgan <alfred.morgan@adecn.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: shebang line parsing changed in FreeBSD6
Message-ID:  <44908BA7.6080908@adecn.com>
In-Reply-To: <44wtbjok1y.fsf@be-well.ilk.org>
References:  <448EE73D.1010606@adecn.com> <44wtbjok1y.fsf@be-well.ilk.org>

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44908BA7.6080908>