Re: shebang line parsing changed in FreeBSD6

[ Available lists | Index of freebsd-questions | Month of Jun 2006 | Week of 14 Jun 2006 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Alfred Morgan <alfred.morgan@adecn.com>
Date
14 Jun 2006 22:20:29
Subject
Re: shebang line parsing changed in FreeBSD6
Message-ID
44908BA7.6080908@adecn.com

In reply to

[ Hide this part ]
 > 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



Elapsed time: 0.110 seconds