0

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?

mohangraj
  • 9,842
  • 19
  • 59
  • 94

1 Answers1

0

I believe that SIGQUIT is Ctrl \
Ctrl D being EOF

Rolf of Saxony
  • 21,661
  • 5
  • 39
  • 60