[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Migrating from tcsh to bash (issues)

From: Matthew Woehlke
Subject: Re: Migrating from tcsh to bash (issues)
Date: Thu, 05 Feb 2009 13:12:44 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20090105 Fedora/ Thunderbird/ Mnenhy/

Simos wrote:
Regarding printexitvalue, I use

trap '__exit_value_bashrc=$?; if [ $__exit_value_bashrc -ne 0 ]; then
echo "Exit $__exit_value_bashrc"; fi' ERR

so that an exit value is printed when it is other than 0.

That shouldn't be necessary. An exit of 0 is not considered an error, and so should not trip an ERR trap. Freddy's example should be sufficient. (WFM with 3.2, anyway.)

Please do not quote my e-mail address unobfuscated in message bodies.
ELANG: input is in wrong language (please use English on English lists)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]