On Fri, Aug 21, 2009 at 4:22 PM, Dieter
Holkenpolk<[email protected]> wrote:
> Consider the shell script:
> false
> false &
> echo $?
>
> The output is 0. The ksh manual says $? is
> "the exit status of the last non-asynchronous command executed."
> What do you think?
Yeah, I think it should be changed to "the exit status of the last
pipeline executed". 'pipeline' instead of 'command' to
a) clarify that "true; false | echo $?" must echo 0 despite 'false'
possibly being
considered the last command executed, and
b) mirror the wording of the standard at
http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#ta
g_18_05_02
(The behavior complies with the standard, so it's a doc issue. Note
that it's already stated in the "Command syntax" section that the exit
status of an asynchronous list is zero.)
Philip Guenther