All pastes #493517 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-05-17 20:29 UTC
rendered paste body
#!/bin/bash

#set -e -E
trap "echo time to die!" ERR

echo "Now running wrong command from the same shell (trap expected)"
nocommand
echo "Exit value is $?"

echo "Now running wrong command a subshell (trap expected, but is not firing)"
(
        nocommand
)
echo Exit value is $?
echo "But the run continued..."