Just a note: you need to exclude your "ps" check from the list of processes returned since it will also match your script path.
I like to use the following trick, so as not to invoke an additional grep:
$ ps aux | grep [i]nit root 1 0.0 0.0 23820 2024 ? Ss 08:23 0:01 /sbin +/init
--
David Serrano
(Please treat my english text just like Perl code, i.e. feel free to notify me of any syntax, grammar, style and/or spelling errors. Thank you!).
In reply to Re^2: How can i check my script is already running?
by Hue-Bond
in thread How can i check my script is already running?
by shekarkcb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |