delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-SWARE-Spam-Status: | No, hits=-0.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW |
X-Spam-Check-By: | sourceware.org |
X-SpamScore: | 6 |
X-BigFish: | VPS6(zzzz1202hzz34b0nz2dh2a8h668h839h944hd25h) |
X-Forefront-Antispam-Report: | CIP:157.55.225.13;KIP:(null);UIP:(null);IPV:NLI;H:AMSPRD0702HT005.eurprd07.prod.outlook.com;RD:none;EFVD:NLI |
From: | John Fairhall <john AT utilibill DOT com DOT au> |
To: | "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com> |
Subject: | RE: cygwin bash include scripting and error code return question |
Date: | Mon, 26 Mar 2012 05:24:19 +0000 |
Message-ID: | <3B35330F74CE0544934D0AAC1FBF7AFD01A8CB@AMSPRD0702MB120.eurprd07.prod.outlook.com> |
References: | <3B35330F74CE0544934D0AAC1FBF7AFD019D01 AT AMSPRD0702MB120 DOT eurprd07 DOT prod DOT outlook DOT com> <4F6FBC46 DOT 30707 AT tlinx DOT org> |
In-Reply-To: | <4F6FBC46.30707@tlinx.org> |
MIME-Version: | 1.0 |
X-OriginatorOrg: | utilibill.com.au |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.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 |
X-MIME-Autoconverted: | from quoted-printable to 8bit by delorie.com id q2Q5Okim025446 |
The pipe is definitely the problem. If I have this: bash mainScript.sh 2>&1 bash mailBuild.sh %ERRORLEVEL% %LOGFILE% When I gimmick mainScript to exit with any non-zero value I get an ERRORLEVEL of 255. However, when I do this: bash -o pipefail mainScript.sh 2>&1 | tee $LOGFILE bash mailBuild.sh %ERRORLEVEL% %LOGFILE% I always get a zero ERRORLEVEL. When I try this: bash -o pipefail -c "mainScript.sh 2>&1 | tee %LOGFILE%" it errors with bash: mainScript.sh: command not found J. -- 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |