Subject: Re: correct shell behaviour?
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@netbsd.org>
From: Andrew Brown <atatat@atatdot.net>
List: tech-userlevel
Date: 08/12/2002 09:54:44
>> Ok then what about:
>> 
>> $ (exit 2)
>> $ a=`echo a; exit 3`
>> $ echo $?
>
>"0"
>
>> The expectation here is that $? refers to the `` pipeline.
>> ie it is possible to test the result of such items.
>
>No, absolutely not.  The last list (pipeline, whatever) is the
>assignment statement.

...which doesn't actually "execute" since it's even less of a built-in
than, eg, echo.  it can't have an exit code, per se, except perhaps as
a reflection of something that happened during the assignment.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."