1*13de33a5SJulio Merino# Most shells print a message when a foreground job is killed by a signal. 2*13de33a5SJulio Merino# POSIX allows this, provided the message is sent to stderr, not stdout. 3*13de33a5SJulio Merino# Some trickery is needed to capture the message as redirecting stderr of 4*13de33a5SJulio Merino# the command itself does not affect it. The colon command ensures that 5*13de33a5SJulio Merino# the subshell forks for ${SH}. 6*13de33a5SJulio Merino 7*13de33a5SJulio Merinoexec 3>&1 8*13de33a5SJulio Merinor=`(${SH} -c 'kill $$'; :) 2>&1 >&3` 9*13de33a5SJulio Merino[ -n "$r" ] 10