This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]