This bug is... now different. But not fixed. Using Dash 0.5.8-2.10, the output I get from the script is:
3 ^CEXIT Ignored 1 Ignored 2 Back
Note that EXIT fires a lot earlier than expected, and the script unexpectedly terminates.
I still see similar behaviour to the original bug (only one line is executed) with this script:
#!/bin/sh set -e
trap 'exit 1' INT trap 'sorry' EXIT
sorry() { echo "Ignored 1"; echo "Ignored 2" sleep 1 echo Back }
for i in 3 2 1; do echo "$i" sleep 1 # || true done
echo OUT
Expected output:
3 ^CIgnored 1 Ignored 2 Back
Actual output:
3 ^CIgnored 1
This bug is... now different. But not fixed. Using Dash 0.5.8-2.10, the output I get from the script is:
3
^CEXIT
Ignored 1
Ignored 2
Back
Note that EXIT fires a lot earlier than expected, and the script unexpectedly terminates.
I still see similar behaviour to the original bug (only one line is executed) with this script:
#!/bin/sh
set -e
trap 'exit 1' INT
trap 'sorry' EXIT
sorry() {
echo "Ignored 1"; echo "Ignored 2"
sleep 1
echo Back
}
for i in 3 2 1; do
echo "$i"
sleep 1 # || true
done
echo OUT
Expected output:
3
^CIgnored 1
Ignored 2
Back
Actual output:
3
^CIgnored 1