X-Spam-Check-By: sourceware.org From: "Dave Korn" To: 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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/