Is it possible to continue after signal is caught and control goes to function specified in the trap statement?
You mean "continue from where the script was interrupted"?
Yes. I would like to come back and continue. The basic idea is to retry for three times and then error out.
Hi Soham,
Could this help you ?
#!/bin/sh
count=0
trap 'CheckSignal' 1 2 15
function CheckSignal
{
echo "recved signal"
count=$(($count + 1 ))
if [ $count -eq 3 ]
then
echo "exiting"
exit
else
echo "continue"
fi
}
while true
do
echo "Test"
sleep 10
done