trap '...' exit int ...
int will cause the script to exit, so '...' get run twice:
#!/bin/ksh
trap 'print a' exit int
sleep 10
^Ca
a
But the natural exit will always causes '...' to run,
which is often not desired.
So should we always write something like
trap 'print a' exit int
...
trap - exit
exit 0
?
--
Michael Wang
http://www.unixlabplus.com/