Subject: Re: bin/17870: /bin/sh bug on expanding $? in here-documents
To: None <netbsd-bugs@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: netbsd-bugs
Date: 08/08/2002 17:48:53
> I think the correct solution is to move the 'oexitstatus = exitstatus'
> from inside the loop in expredir() to before each call to it.
I've tried removing 'oexitstatus' completely, and also removing the
'exitstatus = 0' lines.
This gives a shell where:
(exit 2); echo `echo $?; exit 3` $?
outputs "2 3".
This may be confusing, and may or may not be invalid!
However it seems to treat:
(exit 3); eval echo $(echo \$?)
(exit 3); eval echo `echo \$?`
differently. The first gives 0, the second 3.
David
--
David Laight: david@l8s.co.uk