[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (set -u -e; trap true EXIT; echo $bad) exits 0
From: |
Freddy Vulto |
Subject: |
Re: (set -u -e; trap true EXIT; echo $bad) exits 0 |
Date: |
Fri, 10 Apr 2009 23:47:06 +0200 |
Even within the EXIT trap, the -u error exit status disappears when -e
is used (?):
$ (set -u; trap 'echo $?' EXIT; echo $bad)
bash: bad: unbound variable
1
$ (set -eu; trap 'echo $?' EXIT; echo $bad)
bash: bad: unbound variable
0
Freddy Vulto
http://fvue.nl