Subject: Re: 1.3.15 on W2K: return codes, bash, cmd.exe
From: Stephen Powell <[email-masked]>
To: [email-masked]
Date: Fri, 06 Dec 2002 13:52:53 +1100

On Wed, 04 Dec 2002, [email-masked] wrote:

[...]

> The .bat scripts do some minimal error checking and exit with
> "exit /b 1" on error.

Try it without the /b, just "exit 1".

With /b:
$ cat a.bat
exit /b 2
$ cmd /c a.bat ; echo rc=$?
C:\winnt\temp>exit /b 2 
rc=0

Without /b:
$ cat b.bat
exit 2
$ cmd /c b.bat ; echo rc=$?
C:\winnt\temp>exit 2 
rc=2

$ cmd /ver
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

-- 
Stephen Powell
[email-masked]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/