cygwin.bat improvements (was Re: Cygwin on XP disapearing terminal mystery)

Dave Korn dave.korn@artimi.com
Wed Feb 1 17:55:00 GMT 2006


On 01 February 2006 17:06, Igor Peshansky wrote:
>> Also, "command not found" sets error code to 127, so the "1" above can be
> 	changed to "127". Igor

 ITYM '9009'?
----------------------------------e.g.----------------------------------
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\dk>cd \cygwin\bin
C:\cygwin\bin>bash --login -i
User is dk
dk@rainbow ~> exit
logout
C:\cygwin\bin>echo %ERRORLEVEL%
0
C:\cygwin\bin>ren bash.exe bash.exe.missing
C:\cygwin\bin>bash --login -i
'bash' is not recognized as an internal or external command,
operable program or batch file.
C:\cygwin\bin>echo %ERRORLEVEL%
9009
C:\cygwin\bin>
----------------------------------e.g.----------------------------------
 127 is a posix exit status, and if bash doesn't run, there aren't going to be any posix apps returning posix error status!
Perhaps "if exist" would be a better test if you just want to know if bash is there or not, but "if ERRORLEVEL 1" would hopefully
catch other problems apart from just missing bash.exe (missing dlls / segfaults in startup scripts... who knows?)
 cheers,
 DaveK
-- 
Can't think of a witty .sigline today....
--
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/


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /