bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash 2.04 on Windows 2000 bug...


From: Prasad Dabak
Subject: bash 2.04 on Windows 2000 bug...
Date: 7 Jun 2001 03:06:11 -0700

Hello,

I am facing one problem with bash 2.04 on Windows 2000 platform.

Consider the following two scripts
 
test.sh
        exit 10
test1.sh
        /bin/bash ./test.sh
        echo $?
        a=`echo hello | grep hello`
        /bin/bash ./test.sh
        echo $?
        exit 0
 
Anyone would expect that this script will echo 10 on the screen two times.
If you run test1.sh from the command shell using "bash ./test1.sh", it
echoes 10 and 0. Sounds weird right?.

I observed that, if you execute anything enclosed in backquote (` `) along 
with pipe, from next line, bash stops waiting for any command to finish 
execution. 

In the above case, bash.exe executes test.sh for the first time and echoes 
the result code as 10. However  in second case, it does not wait till test.sh 
finishes execution and hence echoes wrong return code (0).

If you add a line "sleep 0" before the second execution of test.sh, it works
perfect, irrespective of how much time test.sh takes to execute. I dont have
any concrete reason as to why it works.

Can anyone shed some light on this?

Thanks.
-Prasad



reply via email to

[Prev in Thread] Current Thread [Next in Thread]