delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/06/20/11:00:23

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <394F818A.7CBE6BCA@cisco.com>
Date: Tue, 20 Jun 2000 10:36:59 -0400
From: Zhiguang Qian <zqian AT cisco DOT com>
Organization: CPVBU
X-Mailer: Mozilla 4.51C-CISCOENG [en] (X11; U; SunOS 5.6 sun4u)
X-Accept-Language: en
MIME-Version: 1.0
To: "McCunney, Dennis" <DMcCunney AT roper DOT com>, cygwin AT sourceware DOT cygnus DOT com
Subject: Re: Interface between Cygwin and NT CMD Shell
References: <A680DF2C0A29D411B4F60008C7F40FED228743 AT EXCHANGERSW2>

Bash shell passes %errorlevel% to CMD.exe.

Thanks.

Zhiguang


"McCunney, Dennis" wrote:

> > -----Original Message-----
> > From: Zhiguang Qian [mailto:zqian AT cisco DOT com]
> > Sent: Monday, June 19, 2000 11:22 AM
> > To: cygwin AT sourceware DOT cygnus DOT com; cgf AT cygnus DOT com
> > Subject: Re: Interface between Cygwin and NT CMD Shell
> >
> > Here is my situation.
> >
> > I have any application which runs triggers on CMD shell (dos
> > script). I have unix shell scripts and want to use those unix
> > shell scripts on NT. To do it I use cygwin. What I did is to
> > wrap "bash <my_unix_scripts>" in a DOS batch file. Now I need
> > the status of the unix script pass ing back to the
> > application.
>
> How are your Unix scripts setting return codes?  I presume you are using
> "exit X" in your script, where X is the desired return code for the
> particular circumstance under which the script exits?
>
> I _think_ these ought to get passed back up to CMD.EXE, and your batch file
> can do
>
> if errorlevel X if not errorlevel Y <action>
>
> to parse them.  (The construct above is because the DOS "if errorlevel"
> construct tests whether the errorlevel value is equal to _or greater than_
> the target.  The syntax above will let you test only for equality.)
>
> If that _doesn't_ work, I'd use semaphore files on disk, something like
>
> if [ <status> = <failed> ] # however you specify status and failure
> then
>         > /tmp/failed.$$$
> fi
>
> in the bash script, and
>
>   if exist \tmp\failed.$$$ goto failed
>
> :sucess
>   ....
>   ....
>   ....
>   goto end
>
> :failed
>   ....
>   ....
>   ....
>
> :end
>   if exist \tmp\failed.$$$ del \tmp\failed.$$$
>
> The above is off the top of my head, and will need rewriting for you
> particular circumstances.
>
> > Thanks.
> >
> > Zhiguang Qian
> > Cisco Systems
>
> __________________________
> Dennis McCunney
> Technical Manager
> Manhattan Phone Center
> 115 E 23rd St., 11th Floor
> NY, NY 10010
> 212 387 7550 Voice
> 212 387 8180 Fax
> dmccunney AT roper DOT com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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