Subject: Re: bin/17870: /bin/sh bug on expanding $? in here-documents
From: David Laight <firstname.lastname@example.org>
Date: 08/08/2002 17:34:24
> > echo $(echo $?)
> >should output the same as:
> > echo $?
> i'm not convinced of that. do you have a reference to some standard
> that covers this, or is this just what seems right to you?
The 'subshell' inherits everything from the main shell.
This was fixed a few years ago (look at the CVS history for eval.c).
For another one, how about:
(exit 3); eval echo $(echo \$?)
netbsd 'sh' outputs 0, but pdksh outputs 3.
The version I'm playing with now treats `...` differently from $(...)
David Laight: email@example.com