]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - tools/regression/bin/sh/execution/killed2.0
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / tools / regression / bin / sh / execution / killed2.0
1 # $FreeBSD$
2 # Most shells print a message when a foreground job is killed by a signal.
3 # POSIX allows this, provided the message is sent to stderr, not stdout.
4 # Some trickery is needed to capture the message as redirecting stderr of
5 # the command itself does not affect it. The colon command ensures that
6 # the subshell forks for ${SH}.
7
8 exec 3>&1
9 r=`(${SH} -c 'kill $$'; :) 2>&1 >&3`
10 [ -n "$r" ]