Hi all,
I'm experiencing this problem usign "onintr" command: if you run a csh script from a sh prompt, the onintr command has no effect.
Here is the csh script (working fine if run from a csh prompt):
#!/bin/csh
set exitreq = 0
onintr exit_request
while ( 1 == 1 )
if ( $exitreq == 1 ) then
printf "\n\nExit request (via signal 2), exiting..."
exit 2
endif
end
exit_request:
printf "\n\nWARNING: **** signal INTERRUPT (2) received ****...\n"
set exitreq = 1
continue
And here is the problem:
ibdvsmt1{ubmcopyprod} sh
$ mytest.csh &
8650
$ kill -2 8650
$ ps -ef | grep mytest.csh | grep -v grep
eodprod 8650 8475 2 11:16:51 pts/115 0:11 /bin/csh ./mytest.csh
$
Truss output says the signal is received but ignored:
sigprocmask(0, 0x00000000, 0xFFBED3D8) = 0
Received signal #2, SIGINT [ignored]
siginfo: SIGINT pid=5919 uid=5129
sigprocmask(SIG_BLOCK, 0xFFBED3D8, 0xFFBED3C8) = 0
Did anyone have to fight with this ?
Thanks in advance.
Ciao,
Marco