i-bash/tests/set-e-test

20 lines
292 B
Text
Raw Normal View History

1996-08-26 18:22:31 +00:00
if : ; then
set -e
N=95
while :; do
# expr returns 1 if expression is null or 0
set +e
N_MOD_100=`expr $N % 100`
set -e
echo $N_MOD_100
N=`expr $N + 1`
if [ $N -eq 110 ]; then
break
fi
done
set +e
fi
1996-12-23 17:02:34 +00:00
# command subst should not inherit -e
set -e
echo $(false; echo ok)