tech-userlevel archive

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

set -e oddity



Is it expected behaviour that x is still 1 in the EXIT trap?

#!/bin/sh

set -e

trap 'echo $x' EXIT

x=0

f() {
	false
}

x=1 f
~



Home | Main Index | Thread Index | Old Index