Originally posted by: SystemAdmin
Hi
In a script I am checking for the number of processes with the name of the script to avoid multiple instances .. so the script name is runMonitor.sh and as soon as it is invoked, it checks for
ps -ef | grep runMonitor | grep -v grep | wc -l
this returns 2 and so we are trying to list it by
ps -ef | grep runMonitor | grep -v grep
which displays only the current process .. this confuses the script and so it exits without proceeding (as per the code)..
Please can you let me know why this is happening ? Is it a AIX problem ?