Re: #! incompatible -- binfmt_script.c broken?

Matthias Andree (matthias.andree@gmx.de)
Thu, 5 Dec 2002 13:12:50 +0100


On Wed, 04 Dec 2002, Chris Adams wrote:

> Try the following under your shell. On Solaris and Tru64 sh and ksh, it
> is handled with no error. Under bash (on Linux, Solaris, and Tru64), it
> returns an error:
>
> $ set "-- xyzzy"
> $ echo $?
>
> According to SUSv3, bash is not compliant, because for set, under the
> section "CONSEQUENCES OF ERRORS" is listed "None." and the "EXIT STATUS"
> is "Zero."

> Fix the shell(s).

That's correct. But how do you derive that the sh command line must
behave the same? The sh command is not the sh special built-in.

However, it would be reasonable if a /bin/sh set $1 to be "-- xyzzy" if
a file "foo" with

#! /bin/sh -- xyzzy

was executed (as path = [/bin/sh] argv = [./foo] [-- xyzzy]);
and although I didn't check, I wonder how shells without the "--" long
options parse that line.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/