X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:content-transfer-encoding :mime-version; q=dns; s=default; b=SMw+EDj//UIH9WOmuBnYKYsqXNv+C w8ze8vEXC3Y2cDjXXhlrDrrvX0wgjbgnxKbrRHz5kYeeiYfWO/D1rox8I3mrw8nj 3Q+W6xBYl8eXfkJsG2yq1AfRteAU4Z/gOAwLUCWYolpOs880IQZJWjn/3FyUkWSn oEZWkV/DgdTbTc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:content-transfer-encoding :mime-version; s=default; bh=tjKC5Yc0wNMEern9CQBoMzmJ/Cs=; b=MHO zKYOeoKlK0gleiysJlMRqkeHwBDFZZaU5hyxbZP51VrgBM1+8CSMZ3zgixWCeZtj /ZjH/2hGkpYoWtlto3d2jrQo/fFgEYWkzcalipPZugnsMAX0mADfiKZnXaN0jZMy Roq2beZtzJceDDcxxOL3kQG37uw1IbH0G15yXmig= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_05 autolearn=ham version=3.3.2 X-HELO: USA7109MR006.ACS-INC.COM From: "Nellis, Kenneth" To: "cygwin AT cygwin DOT com" Subject: RE: ERRORLEVEL not returning to Cygwin shell Date: Fri, 11 Oct 2013 14:35:33 +0000 Message-ID: <0D835E9B9CD07F40A48423F80D3B5A7028690FDD@USA7109MB022.na.xerox.net> References: <5257FE1A DOT 5050905 AT cygwin DOT com> In-Reply-To: <5257FE1A.5050905@cygwin.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id r9BEbIwV016003 > From: Larry Hall (Cygwin) > > On 10/11/2013 8:27 AM, paul hermeneutic wrote: > > I am using CYGWIN_NT-5.1 PAC047922 1.7.25(0.270/5/3) 2013-08-31 20:39 > > i686 Cygwin > > > > An exit code returned by a DOS batch file does not seem to be coming > > back to the Cygwin shell. I am using bash. > > > > $ cat myexit.bat > > @echo off > > set EXITCODE=%1 > > echo got here with %1 > > exit /b %EXITCODE% > > > > $ cmd /c c:/DOCUME~1/pwatson/bin/myexit.bat 8 > > got here with 8 > > > > $ echo $? > > 0 > > WJFFM. Same version, same arch. Guess you need to do some more digging. FWIW, I get the same results as the OP: $ cat myexit.bat @echo off set EXITCODE=%1 echo got here with %1 exit /b %EXITCODE% $ cmd /c myexit.bat 8 got here with 8 $ echo $? 0 $ uname -r 1.7.25(0.270/5/3) $ For grins, I tried with both Unix and DOS line endings. Made no difference. --Ken Nellis -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple