Subject: sh exit trap problem
To: None <>
From: Wolfgang S. Rupprecht <>
List: current-users
Date: 01/10/2005 11:34:48
Under bash, when one types a ^C to terminate the following script the
echo outputs echo-ed msg as expected.  Under sh, nothing happens other
than the shell script terminating immediately.  Is this a bug or
simply undefined behavior that sh is implementing differently?

    # this sets the handler correctly in bash, but not in /bin/sh
    trap "echo caught pseudo-sig EXIT" 0
    sleep 3