Re: Proposed new POSIX sh policy
Bruce Sass <firstname.lastname@example.org> writes:
> On Wed November 15 2006 16:45, Russ Allbery wrote:
>> No, but Policy currently requires scripts that use features not
>> available from POSIX to declare an appropriate shell, and POSIX
>> doesn't guarantee the binary -a operator.
> Since all sh's in Debian provide compatible binary -a operators,
> #!/bin/sh is appropriate when that operator is used and Policy is not
> being violated. Ya?
I suppose you could read it that way, but I think that's strained.
The standard shell interpreter /bin/sh can be a symbolic link to any
POSIX compatible shell, if echo -n does not generate a newline.
Thus, shell scripts specifying /bin/sh as interpreter must only use
POSIX features. If a script requires non-POSIX features from the shell
interpreter, the appropriate shell must be specified in the first line
of the script (e.g., #!/bin/bash) and the package must depend on the
package providing the shell (unless the shell package is marked
"Essential", as in the case of bash).
I'd rather make the situation clearer.
> I don't see why scripts would need to change. I can see how mention
> of -a in Policy could be considered as cruft, but it would serve to
> identify -a as a requirement, in addition to POSIX, which any command
> interperter in Debian purporting to be "sh" needs to abide by... is
> that what you are trying to get clarified?
> Sorry, I got lost trying to follow all the diffs to Policy I've seen.
It's partly my fault because I need to generate a new diff for further
discussion and keep getting pulled away by other things. I'll hopefully
be able to do that soon.
Russ Allbery (email@example.com) <http://www.eyrie.org/~eagle/>