I have written a script and it is working fine . It do some tail and grep operations. When I am closing my terminal and the greping the PID of my script , I can find the script is still present in the output of "ps -eaf |grep -i myScript.sh" . However I do not want this behaviour. I need to know , how can I handle such situation . I do not want to burden the CPU by my script. Please let me know. I searched google, and I mostly found about "How to keep the script running in background". but I was not able to get anything concreat about stopping it.
Thanks in advance.
user 9405 18803 0 07:32 pts/72 00:00:00 grep 29735
user 29735 11903 0 07:24 pts/30 00:00:00 sh myScript.sh
user 29818 29735 0 07:24 pts/30 00:00:00 tail -f --pid=29735 /var/log/message
user 29830 29735 0 07:24 pts/30 00:00:00 -csh