summaryrefslogtreecommitdiffhomepage
path: root/tests/posix/exec-fail.sh
blob: bd4f48988f0a2fd7fff1c708f23c9c553dcd66da (plain)
1
2
3
4
5
6
# A failed `exec` must still run the EXIT trap, and report "not found" with
# status 127 (POSIX 2.8.1: a special built-in that fails exits the shell).
"$TSH" -c 'trap "echo bye" EXIT; exec /nonexistent/cmd' 2>&1 |
    grep -c 'not found'
"$TSH" -c 'trap "echo bye" EXIT; exec /nonexistent/cmd' 2>/dev/null
echo "status $?"