1.3.15 on W2K: return codes, bash, cmd.exe

Stephen Powell stephen_powell@optusnet.com.au
Fri Dec 6 02:23:00 GMT 2002


On Wed, 04 Dec 2002, angela@dragaera.releasedominatrix.com 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
stephen_powell@optusnet.com.au



--
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/



More information about the Cygwin mailing list