Script:
echo $$
trap "echo \"hai\"" 3
while [ 1 ]
do
ls >/dev/null
done
My requirement is to trap the SIGQUIT signal. So I execute the above script and press (CTRL + D). But it doesn't trap the signal and it didn't print "hai". But it is properly worked if the signal is sent via 'kill -3 '. So, why CTRL+D is not worked?