So far I used
trap " call function" 2
fucntion
{
./test.sh
exit
}
but it never reaches the exit line and a whole bunch of process piles up any one got any idea?
I tried & (bg) but i need to be able to keep doing it , the bg only allows me to do it once The point of it is when i type ctrl C it should terminate the original test.sh but it should also call itself before terminating hence create a new process.
This is what i have so far
while [ 1 ]
do
count=0;
echo $count
count=`expr $count + 1`
done
trap "restart" 2 ( for the ctrl c)
restart()
{
./callitself.sh
exit ( it never reaches here therefore it doesnt kill the original process which is what i need otherwise it works fine)
}