![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Monitoring a single process in solaris | jayana | SUN Solaris | 3 | 05-31-2008 03:35 AM |
| Monitoring for a hung process | prismtx | Shell Programming and Scripting | 2 | 03-08-2008 09:31 AM |
| monitoring process list via snmp, hrSWRun | Bzubi | AIX | 0 | 10-18-2007 05:43 AM |
| Process Monitoring Script Help | rdc69 | Shell Programming and Scripting | 0 | 08-30-2006 07:55 PM |
| Monitoring ftp process | arkhewit | UNIX for Dummies Questions & Answers | 2 | 06-29-2005 07:56 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
[Solved] process monitoring
hi all,
i would like to write the shell script to monitoring the processing, but if i passing the parameter the number of process is incorrect how to slove it? many thx got the correct number of process as following script: =========================================================== #!/bin/sh isRunning=`ps -ef | grep -v grep | grep processName.sh | wc -l` if [ $isRunning -eq 1 ] then echo "running" else echo "not running" fi =========================================================== got the incorrect number of process if passing param =========================================================== #!/bin/sh isRunning=`ps -ef | grep -v grep | grep $1 | wc -l` isRunning=`ps -ef | grep -v grep | grep "$1" | wc -l` <-- other way if [ $isRunning -eq 1 ] then echo "running" else echo "not running" fi =========================================================== Last edited by eric_wong_ch; 10-11-2007 at 07:09 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|