public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* 1.3.15 on W2K: return codes, bash, cmd.exe
@ 2002-12-04 17:05 Angela Marie Thomas
  2002-12-06  2:23 ` Stephen Powell
  0 siblings, 1 reply; 4+ messages in thread
From: Angela Marie Thomas @ 2002-12-04 17:05 UTC (permalink / raw)
  To: cygwin

cygwin v1.3.15 on Windows 2000 Server, COMSPEC is cmd.exe 

I searched in the FAQ and list archives and could not find an
answer/solution to my question.

I'm currently supporting a very lame build system that contains bash
script that calls a series of .bat scripts.  The .bat scripts do some
minimal error checking and exit with "exit /b 1" on error.  Unfortunately,
this exit code doesn't seem to make it to the bash script.  If a .bat
file exits with "exit 1", the shell does seem to get the error code.
Unfortunately, this isn't a possible workaround since these .bat files
are also run from DOS shells.  I tried using ash as well but got the
same results.  Is this a known problem?

Per the web page, I'm including "cygcheck -s -v -r" output at the end
of my message.  For security reasons, I've removed hostname and other
host identifying information.

Thanks

--Angela

Cygwin Win95/NT Configuration Diagnostics
Current System Time: Wed Dec 04 16:09:16 2002

Windows 2000 Server Ver 5.0 Build 2195 Service Pack 3

Path:	C:\cygwin\usr\local\bin
	C:\cygwin\bin
	C:\cygwin\bin
	c:\Vendor\Borland\CBUILD~1\Projects\Bpl
	c:\Vendor\Borland\CBUILD~1\Bin
	c:\lbin
	c:\lbin\infozip
	C:\cygwin\bin
	c:\Perl\bin
	c:\Program Files\Perforce
	c:\Program Files\Common Files\VERITAS Shared
	c:\PROGRA~1\VERITAS\NetBackup\bin
	c:\WINNT\system32
	c:\WINNT
	c:\WINNT\System32\Wbem

SysDir: C:\WINNT\System32
WinDir: C:\WINNT

HOME = `C:\cygwin\home\Administrator'
MAKE_MODE = `unix'
PWD = `/home/Administrator'
USER = `Administrator'

ALLUSERSPROFILE = `C:\Documents and Settings\All Users'
APPDATA = `C:\Documents and Settings\angela\Application Data'
COMMONPROGRAMFILES = `C:\Program Files\Common Files'
COMSPEC = `C:\WINNT\system32\cmd.exe'
HOMEDRIVE = `C:'
HOMEPATH = `\Documents and Settings\angela'
MANPATH = `:/usr/ssl/man'
NUMBER_OF_PROCESSORS = `2'
OLDPWD = `/usr/bin'
OS2LIBPATH = `C:\WINNT\system32\os2\dll;'
OS = `Windows_NT'
PATHEXT = `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
PROCESSOR_ARCHITECTURE = `x86'
PROCESSOR_IDENTIFIER = `x86 Family 6 Model 8 Stepping 3, GenuineIntel'
PROCESSOR_LEVEL = `6'
PROCESSOR_REVISION = `0803'
PROGRAMFILES = `C:\Program Files'
PROMPT = `$P$G'
PS1 = `\[\033]0;\w\007
\033[32m\]\u@\h \[\033[33m\w\033[0m\]
$ '
SESSIONNAME = `RDP-Tcp#5'
SHLVL = `1'
SYSTEMDRIVE = `C:'
SYSTEMROOT = `C:\WINNT'
TEMP = `c:\DOCUME~1\angela\LOCALS~1\Temp\1'
TERM = `cygwin'
TMP = `c:\DOCUME~1\angela\LOCALS~1\Temp\1'
TOLIST = `angela@tivo.com'
USERNAME = `angela'
USERPROFILE = `C:\Documents and Settings\angela'
WINDIR = `C:\WINNT'
_ = `/usr/bin/cygcheck'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  cygdrive flags = 0x00000022
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = `C:\cygwin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
  (default) = `C:\cygwin/bin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
  (default) = `C:\cygwin/lib'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options

a:  fd           N/A    N/A                    
c:  hd  NTFS   34676Mb  43% CP CS UN PA FC     
d:  cd  CDFS     242Mb 100%    CS UN           Wise Solutions
u:  net NTFS   329999Mb  93% CP CS UN PA FC     New Volume

C:\cygwin      /          system  binmode
C:\cygwin/bin  /usr/bin   system  binmode
C:\cygwin/lib  /usr/lib   system  binmode
.              /cygdrive  user    binmode,cygdrive

Found: C:\cygwin\bin\bash.exe
Found: C:\cygwin\bin\cat.exe
Not Found: cpp (good!)
Found: C:\cygwin\bin\find.exe
Not Found: gcc
Not Found: gdb
Not Found: ld
Found: C:\cygwin\bin\ls.exe
Found: c:\Vendor\Borland\CBUILD~1\Bin\make.exe
Found: C:\cygwin\bin\sh.exe

   58k 2002/05/07 C:\cygwin\bin\cygbz2-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygbz2-1.dll" v0.0 ts=2002/5/6 23:33
  643k 2002/11/09 C:\cygwin\bin\cygcrypto.dll - os=4.0 img=1.0 sys=4.0
                  "cygcrypto.dll" v0.0 ts=2002/11/9 1:56
   45k 2001/04/25 C:\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0
                  "cygform5.dll" v0.0 ts=2001/4/24 22:28
   35k 2002/01/09 C:\cygwin\bin\cygform6.dll - os=4.0 img=1.0 sys=4.0
                  "cygform6.dll" v0.0 ts=2002/1/8 22:03
   19k 2002/02/20 C:\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm.dll" v0.0 ts=2002/2/19 19:05
   17k 2001/06/28 C:\cygwin\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory4.dll" v0.0 ts=2001/1/6 20:34
   20k 2002/10/10 C:\cygwin\bin\cyghistory5.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory5.dll" v0.0 ts=2002/10/10 10:28
  929k 2002/06/24 C:\cygwin\bin\cygiconv-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygiconv-2.dll" v0.0 ts=2002/6/24 11:24
   22k 2001/12/13 C:\cygwin\bin\cygintl-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-1.dll" v0.0 ts=2001/12/13 1:28
   28k 2002/09/20 C:\cygwin\bin\cygintl-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-2.dll" v0.0 ts=2002/9/19 20:13
   26k 2001/04/25 C:\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu5.dll" v0.0 ts=2001/4/24 22:27
   20k 2002/01/09 C:\cygwin\bin\cygmenu6.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu6.dll" v0.0 ts=2002/1/8 22:03
  156k 2001/04/25 C:\cygwin\bin\cygncurses++5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++5.dll" v0.0 ts=2001/4/24 22:29
  175k 2002/01/09 C:\cygwin\bin\cygncurses++6.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++6.dll" v0.0 ts=2002/1/8 22:03
  226k 2001/04/25 C:\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses5.dll" v0.0 ts=2001/4/24 22:17
  202k 2002/01/09 C:\cygwin\bin\cygncurses6.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses6.dll" v0.0 ts=2002/1/8 22:03
   15k 2001/04/25 C:\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel5.dll" v0.0 ts=2001/4/24 22:27
   12k 2002/01/09 C:\cygwin\bin\cygpanel6.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel6.dll" v0.0 ts=2002/1/8 22:03
   40k 2001/11/21 C:\cygwin\bin\cygpcre.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcre.dll" v0.0 ts=2001/11/21 14:15
   39k 2001/11/21 C:\cygwin\bin\cygpcreposix.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcreposix.dll" v0.0 ts=2001/11/21 14:15
   22k 2002/06/09 C:\cygwin\bin\cygpopt-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygpopt-0.dll" v0.0 ts=2002/6/8 22:45
  108k 2001/06/28 C:\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline4.dll" v0.0 ts=2001/1/6 20:34
  127k 2002/10/10 C:\cygwin\bin\cygreadline5.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline5.dll" v0.0 ts=2002/10/10 10:28
  169k 2002/11/09 C:\cygwin\bin\cygssl.dll - os=4.0 img=1.0 sys=4.0
                  "cygssl.dll" v0.0 ts=2002/11/9 1:56
   50k 2002/03/12 C:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0
                  "cygz.dll" v0.0 ts=2002/3/11 20:38
  906k 2002/11/07 C:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=2002/11/7 10:57
    Cygwin DLL version info:
        DLL version: 1.3.15
        DLL epoch: 19
        DLL bad signal mask: 19005
        DLL old termios: 5
        DLL malloc env: 28
        API major: 0
        API minor: 63
        Shared data: 3
        DLL identifier: cygwin1
        Mount registry: 2
        Cygnus registry name: Cygnus Solutions
        Cygwin registry name: Cygwin
        Program options name: Program Options
        Cygwin mount registry name: mounts v2
        Cygdrive flags: cygdrive flags
        Cygdrive prefix: cygdrive prefix
        Cygdrive default prefix: 
        Build date: Thu Nov 7 13:57:47 EST 2002
        CVS tag: cygwin-1-3-15-1
        Shared id: cygwin1S3


Cygwin Package Information
Last downloaded files to: @
Last downloaded files from: @

Package             Version             
_update-info-dir    00087-1             
ash                 20020731-1          
base-files          1.0-1               
base-passwd         1.0-1               
bash                2.05b-7             
bzip2               1.0.2-2             
cpio                2.4.2               
cygutils            1.1.3-1             
cygwin              1.3.15-2            
diff                1.0-1               
diffutils           2.8.1-1             
file                3.37-1              
fileutils           4.1-1               
findutils           4.1.7-4             
gawk                3.1.1-5             
gdbm                1.8.0-4             
grep                2.5-1               
gzip                1.3.3-4             
less                374-1               
libbz2_1            1.0.2-2             
libiconv2           1.8-2               
libintl1            0.10.40-1           
libintl2            0.11.5-1            
libncurses5         5.2-1               
libncurses6         5.2-8               
libpopt0            1.6.4-4             
libreadline4        4.1-2               
libreadline5        4.3-2               
login               1.6-1               
ncurses             5.2-8               
openssl             0.9.6g-2            
patch               2.5-3               
pcre                3.7-1               
readline            4.3-2               
sed                 4.0.1-1             
sh-utils            2.0-2               
tar                 1.13.25-1           
termcap             20020930-1          
terminfo            5.2-3               
texinfo             4.2-4               
textutils           2.0.21-1            
time                1.7-1               
vim                 6.1-2               
wget                1.8.2-1             
which               1.5-1               
zlib                1.1.4-1             

Use -h to see help about each section

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 1.3.15 on W2K: return codes, bash, cmd.exe
  2002-12-04 17:05 1.3.15 on W2K: return codes, bash, cmd.exe Angela Marie Thomas
@ 2002-12-06  2:23 ` Stephen Powell
  2002-12-06 10:28   ` Shankar Unni
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Powell @ 2002-12-06  2:23 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 1.3.15 on W2K: return codes, bash, cmd.exe
  2002-12-06  2:23 ` Stephen Powell
@ 2002-12-06 10:28   ` Shankar Unni
  2002-12-06 10:42     ` Christopher Faylor
  0 siblings, 1 reply; 4+ messages in thread
From: Shankar Unni @ 2002-12-06 10:28 UTC (permalink / raw)
  To: cygwin

Stephen Powell wrote:

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

Notice that she said she tried it, it works, but is not an option for 
her because they need to be invoked from DOS command shells as well, and 
she doesn't want the bat files to cause those shells to exit.




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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 1.3.15 on W2K: return codes, bash, cmd.exe
  2002-12-06 10:28   ` Shankar Unni
@ 2002-12-06 10:42     ` Christopher Faylor
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher Faylor @ 2002-12-06 10:42 UTC (permalink / raw)
  To: cygwin

On Fri, Dec 06, 2002 at 10:19:30AM -0800, Shankar Unni wrote:
>Stephen Powell wrote:
>
>>Try it without the /b, just "exit 1".
>
>Notice that she said she tried it, it works, but is not an option for 
>her because they need to be invoked from DOS command shells as well, and 
>she doesn't want the bat files to cause those shells to exit.

Angela is a former valued colleague of mine from Cygnus and Red Hat
days, so I offered some suggestions in private email.

It looks like if she changes the invocation of her .bat files from just
"foo.bat" to "cmd /c call foo.bat" then an "exit /b" in foo.bat will
work correctly.

I'm contemplating making a change to cygwin to cause this to be the
default.

cgf

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-12-06 18:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-04 17:05 1.3.15 on W2K: return codes, bash, cmd.exe Angela Marie Thomas
2002-12-06  2:23 ` Stephen Powell
2002-12-06 10:28   ` Shankar Unni
2002-12-06 10:42     ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).