| delorie.com/archives/browse.cgi | search |
| X-Spam-Check-By: | sourceware.org |
| From: | "Dave Korn" <dave DOT korn AT artimi DOT com> |
| To: | <cygwin AT cygwin DOT com> |
| Subject: | RE: cygwin.bat improvements (was Re: Cygwin on XP disapearing terminal mystery) |
| Date: | Wed, 1 Feb 2006 17:54:57 -0000 |
| Message-ID: | <000401c62758$9d137060$a501a8c0@CAM.ARTIMI.COM> |
| MIME-Version: | 1.0 |
| In-Reply-To: | <Pine.GSO.4.63.0602011147430.9860@access1.cims.nyu.edu> |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
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 AT 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/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |