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/
This archive was generated by hypermail 2b29 : Sat Dec 07 2002 - 22:00:22 EST