[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 'set -e' and 'trap 0' togheter does not work as expected on syntax e
From: |
Stefano Lattarini |
Subject: |
Re: 'set -e' and 'trap 0' togheter does not work as expected on syntax errors |
Date: |
Sat, 22 Aug 2009 11:31:31 +0200 |
User-agent: |
KMail/1.11.4 (Linux/2.6.26-1-686; KDE/4.2.4; i686; ; ) |
At Saturday 22 August 2009, Chet Ramey <chet.ramey@case.edu> wrote:
> Stefano Lattarini wrote:
>> I have the following scripts:
>>
>> [CUT]
>>
>> I thought that when bash detect a syntax errors in the script,
>> it would pass a $? != 0 to the code in the exit trap, regardless
>> of whether `set -e' is active or not.
>
> It's not exactly a bug -- this behavior isn't standardized
> anywhere, and historical shells behave differently. The behavior
> you want is useful enough that I'll change it for bash-4.1, though.
>
> Chet
Thanks, much appreciated.
Oh, and by the way, sorry for the duplicate message.
Regards,
Stefano