Hi, for some reason, our test system and our live system have differing linux versions (live 7.3; test 8.2), don't ask me why..
This makes my life a little difficult, as my scripts need to work on both systems, taking discrepencies into account.
For example..
I am trying to find out if my script is already running an instance. If it is already running, I want the new instance to die.
I use the following linux command to count the occurences of the programs name in the running process list.
ps aux | grep -c prog.pl 2>/dev/null
On the Test system 8.2, It returns 2 occurences of the prog name. One for the current instance, and one for the ps aux | grep -c prog.pl 2>/dev/null itself.
On the Live system 7.3, it returns 3 occurences of the prog name, one for the current instance, one for the ps aux | grep -c prog.pl 2>/dev/null itself, and an extra grep command.
Any ideas as to how I can get this worknig on BOTH systems?
Thanks
This makes my life a little difficult, as my scripts need to work on both systems, taking discrepencies into account.
For example..
I am trying to find out if my script is already running an instance. If it is already running, I want the new instance to die.
I use the following linux command to count the occurences of the programs name in the running process list.
ps aux | grep -c prog.pl 2>/dev/null
On the Test system 8.2, It returns 2 occurences of the prog name. One for the current instance, and one for the ps aux | grep -c prog.pl 2>/dev/null itself.
On the Live system 7.3, it returns 3 occurences of the prog name, one for the current instance, one for the ps aux | grep -c prog.pl 2>/dev/null itself, and an extra grep command.
Any ideas as to how I can get this worknig on BOTH systems?
Thanks