Greg Wooledge wrote:
> Just for the record, ping is the *classic* example of an incorrectly
> written application that traps SIGINT but doesn't kill itself with
> SIGINT afterward.  (This seems to be true on multiple systems -- at
> the very least, HP-UX and Linux pings both suffer from it.)

The command I run into the problem most with is 'rsync' in a loop.

  EXIT VALUES
       0      Success
  ...
       20     Received SIGUSR1 or SIGINT

Which forces me to write such things this way.

  rsync ...
  rc=$?
  if [ $rc -eq 20 ]; then
    kill -INT $$
  fi
  if [ $rc -ne 0 ]; then
    echo "Error: failed: ..." 1>&2
    exit 1
  fi

Bob

Reply via email to