This is the mail archive of the
cygwin
mailing list for the Cygwin project.
pdksh not setting $? with exit status of commands
- From: David Kramer <david at thekramers dot net>
- To: cygwin at cygwin dot com
- Date: Wed, 19 Jan 2005 15:20:12 +0000 (UTC)
- Subject: pdksh not setting $? with exit status of commands
When I execute commands in the pdksh shell that should set an exit value, $? is
not being set. When I use the bash shell, it is.
In pdksh:
/c/windevel> grep o regexps
oo
/c/windevel> echo $?
0
/c/windevel> grep Z regexps
/c/windevel> echo $?
0
In bash:
/c/windevel> grep o regexps
oo
/c/windevel> echo $?
0
/c/windevel> grep Z regexps
/c/windevel> echo $?
1
Grep is just one command I'm using for demonstration. This is true of all
commands I've tried so far. Even when I write my own script and exit 1 from it,
$? is zero afterwards, which is really hurting my automation efforts.
Oh, and I have to use a ksh-like shell, because the same scripts need to run on
an AIX box with ksh and no bash.
Thanks.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/