Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

trapping sigchld?



I am confused by the way zsh traps signals.  I want to catch a
SIGCHLD in a script:

-------------- snip -------------
#!/usr/bin/zsh

sigchild_handler () {
  echo got SIGCHLD
  running=0
}

# SIGCHLD == 17 on Linux
trap sigchld_handler 17

# run background job
running=1
sleep 30 &

while [ $running = 1 ]; do 
  echo -n .
  sleep 1
done
-------------- snip -------------

When the background job completes, the sigchild handler is called
as expected.  But if I send a SIGCHLD manually, it is ignored:

  $ killall -17 zsh

This works fine with other signals.  Is it a bug, a feature, or am
I doing something wrong?

Bye

Dominik ^_^  ^_^



Messages sorted by: Reverse Date, Date, Thread, Author