In bourne shell, i can trap most of signals :
#! /bin/sh
trap "echo SIGINT and SIGTSTP are trapped ..." 2 24
clear
echo "Waiting ..."
while [ -z "" ]
do
:
done
In csh manual says that we can trap SIGINT signal with onintr command :
#! /bin/csh
onintr trap-STOP
clear
echo "Waiting ..."
loop:
while (1)
:
end
trap-STOP:
echo "SIGINT is trapped"
goto loop
Is it possible to trape another signal than SIGINT in a csh script ?
Thank you.
--
Pascal Riou
mailto:Pasca...@vz.cit.alcatel.fr
tel : (1) 01-30-77-33-48
Fax : (1) 01-30-77-83-15
No.
A workaround is easy--just write all your scripts in Bourne shell. See
ftp://rtfm.mit.edu/pub/usenet/comp.unix.shell/Csh_Programming_Considered_Harmful
for more details.
--Dave
Nope.
-Brian
--
,---. ,---. ,---. ,---. ,---. ,---. ,---.
/ _ \ / _ \ / _ \ / _ \ / _ \ / _ \ / _ \
.' / \ `.' / mailto:bsh2...@challenger.atc.fhda.edu \ `.' / \ `.
__,' `.___,' `.___,' `.___,' `.___,' `.___,' `.___,' `.__