Hi,
I am new to scripting and learning. please share your knowledge with me.
I have a scenario, that i need to trace whether the background script is still running or not? if it was running i need to kill it. i am using the below scripts , but it is not working i dont know why
. please help me to overcome this.
script1.sh
------------
#! bin/sh
echo "hai this is the world of unix"
sleep 200s
script2.sh
---------
#! bin/sh
sh script1.sh &
BGDP=$!
while [ BGDP > 0 ]
do
echo " still running"
kill $BGDP
done
out put from this script is:
still running
still running
.....
please help me to solve this.
Thanks in advance,
G.K.K