delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/02/22/12:26:31

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <20020222172334.46980.qmail@web10506.mail.yahoo.com>
Date: Fri, 22 Feb 2002 09:23:34 -0800 (PST)
From: Rick Rankin <rick_rankin AT yahoo DOT com>
Subject: Re: How can I get Cygwin to see the NT ERRORLEVEL Environment Variable
To: Jon Belinfante <Jon_Belinfante AT cwb DOT com>, cygwin AT cygwin DOT com
In-Reply-To: <80256B68.005CC6B4.00@venus.cwb.com>
MIME-Version: 1.0

ERRORLEVEL is a variable that is set and maintained by cmd.exe. The Cygwin
(actually bash) equivalent would be the variable $?, e.g.,

some_command param1 param2 ...
if [ $? != 0]
then
  # The command failed
fi

There are a number of possible variations on this syntax. The equivalent exists
for csh/tcsh, but I don't use any of the csh-like shells, so I don't know the
syntax off the top of my head.

--Rick
--- Jon Belinfante <Jon_Belinfante AT cwb DOT com> wrote:
> Doing echo $ERRORLEVEL on cygwin returns a blank
> where doing echo %ERRORLEVEL% at a DOS prompt returns 0.
> 
> Has anyone got any ideas
> 
> 
> 
> 
>
******************************************************************************************************************************************************
> This e-mail has been prepared using information  believed  by  the  author to
> be
> reliable and accurate, but Thales Information Systems Finance makes  no
> warranty  as to accuracy or completeness. In particular Thales Information
> Systems Finance does not  accept  responsibility  for  changes  made to this
> e-mail after it was sent.  Any  opinions expressed in this document are those
> of
> the author and do  not  necessarily reflect the opinions of the company or
> its
> affiliates. They may be subject to change without notice.
> This  e-mail,  its  content  and any files transmitted with it are intended
> solely   for   the  addressee(s)  and  may  be legally  privileged  and/or
> confidential. Access by any other party is unauthorised without the express
> written permission of the sender. If you have received this e-mail in error
> you
> may  not  copy  or use the contents, attachments or information in any way.
> Please  destroy  it and contact the sender via the Thales Information Systems
> Finance switchboard in London at +44  (0) 20 7650 0100 or via e-mail return.
> This message and any attachments have been scanned
> for viruses prior to leaving the originators network. The originator does not
> guarantee the security of this message and will not be responsible for any
> damages arising from any alteration of this message by a third party or as a
> result of any virus being passed on.
>
*******************************************************************************************************************************************************
> 
> 
> 
> --
> 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/
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019