trap problem in subshell

trap problem in subshell

Post by wavele » Mon, 30 Sep 2002 09:24:18



why can i still get the "interrupt" information when
i press CTRL_C in following script?
Please make clear what's trap usage and scope?specially
its affection in system call such as metastat

---test1----
#!/usr/bin/ksh
func1()
{
trap '' 1 2 3 15
while true
do
metastat
done
trap -

Quote:}

trap '' 1 2 3 15
echo "main start!"
func1
echo "main end!"
trap -

#test1
^C
[bjh027]-> ^C
[bjh027]-> t
main start!
^Cmetastat: Interrupt