Subject: longstanding ash -c bug [FreeBSD report]
To: None <FreeBSD-gnats-submit@freebsd.org>
From: john hood <cgull@smoke.marlboro.vt.us>
List: netbsd-bugs
Date: 12/01/1995 04:10:12
>Submitter-Id:   current-users
>Originator:     john hood
>Organization:   none
>Confidential:   no
>Synopsis:       /bin/sh -c does not ignore SIGINT
>Severity:       serious
>Priority:       high
>Category:       bin
>Release:        FreeBSD 2.0-BUILT-19950603 i386
>Class:          sw-bug
>Environment: 

any variant of the Almquist shell I've ever tested, including netbsd
0.9, netbsd 1.0-current-sparc of about six months ago, freebsd
1.1.5.1, freebsd 2.1.5, the antique Linux port of the Almquist shell,
and the way ancient comp.sources.unix distribution by Almquist himself

(yes, i've been extremely lame about this bug)

>Description: 

'sh -c command' does not ignore/handle SIGINT while waiting for command
to complete.

>How-To-Repeat: 

keyboard SIGINT in emacs or vi while posting in trn, or try
this interactive ditty and see if the subshell keeps on running:

------------------------------8<------------------------------
#!/bin/sh
#
# test sig handling in sh -c
#
# create second script
TF=/tmp/test.$$
cat > $TF <<\/EOF
#!/bin/sh
echo -e "shell c flags: $-"
trap
trap : 2 3
echo "Type ^C and ^\\"
for i in a b c d e
do
  sleep 1
  echo shell c: $i
done
/EOF
chmod a+x $TF

if [ $# != 1 ]
then
  echo "$0 shell-to-test"
  exit 1
fi
SHELL=$1
echo -e "shell a flags: $-"
trap
trap : 2 3
$SHELL -c "echo shell b flags: $-; trap; $TF"
echo 'shell a exit: ' $?
rm $TF
------------------------------8<------------------------------

>Fix: 
	
none