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 To: "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> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: utilibill.com.au 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 Content-Transfer-Encoding: 8bit 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