Mail Archives: djgpp-workers/2000/07/23/17:20:46
This is a multi-part message in MIME format.
--------------EC414548B5A5C12101E5371B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello.
"Mark E." wrote:
>
> I wrote:
>
> > I think there may be a bug in bash 2.03's handling of compound
> > commands. For instance, if 'bob' does not exist, then you'd expect $?
> > to be set to 127 after trying to execute it. However, I found the
> > following:
> >
> > DJGPP: "(bob); echo $?" -> 0 displayed
> > Linux: "(bob); echo $?" -> 127 displayed
> >
>
> Hmm,
> I get 127 from this snippet with both Bash 2.03 and Bash 2.04.
It turned out that I was actually using bash 1.14.7. I upgraded to bash
2.03 and retested. The above commands work correctly in interactive mode
under bash 2.03, unlike under bash 1.14.7. However, compound commands
don't seem to work correctly in scripts. If I run the attached script,
testcomp.sh, I get the following output:
bash-2.03$ ./testcomp.sh
+ bob
./testcomp.sh: bob: command not found
+ echo 127
127
+ echo 0
0
+ set +x
This happens with $SHELL set to C:\WINDOWS\COMMAND.COM or
c:\djgpp\bin\bash.exe.
Bye,
--
Richard Dawe
[ mailto:richdawe AT bigfoot DOT com | http://www.bigfoot.com/~richdawe/ ]
--------------EC414548B5A5C12101E5371B
Content-Type: application/x-sh;
name="testcomp.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="testcomp.sh"
#! /bin/sh
set -x
(bob; echo $?)
echo $?
set +x
--------------EC414548B5A5C12101E5371B--
- Raw text -