Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com From: David Kramer Subject: pdksh not setting $? with exit status of commands Date: Wed, 19 Jan 2005 15:20:12 +0000 (UTC) Lines: 30 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet AT sea DOT gmane DOT org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 68.166.51.238 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3) X-IsSubscribed: yes 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/