shell script to read ps -e output and determine process double processes.
hi. I just noticed doing ps -e that there was three instances of mplayer running. I am thinking of making a script to search the output of pe -e and determine if there are multiples of a program running. i am not sure as to how i can go about storing the output in a variable to make it easy to test against. Can anyone steer me in the right direction? thanks for your replies in advance.
|
simple approach would be to grep the results in a count based on line and run test on it
ps -e | grep mplayer | wc -l store as variable and run test on it like i=$(ps -e | grep mplayer | wc l) if [ i -gt 1 ] then do don |
All times are GMT -5. The time now is 09:43 AM. |