This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: cygwin bash include scripting and error code return question


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]