Hi
I want to monitor the number of processes the easyest way is
But error handling would be a lot easyere if I knew the processes that where capturede - ex.
The last one enables me to view the processes that where captures.
The problem is that last method acturly has an empty line if no processes is captures.
ex
I've tryede putting |awk NF but no result.
Any ideers?
Thanks
Lhg
I want to monitor the number of processes the easyest way is
Code:
ps -ef|grep <process>|grep -v grep|wc -l
But error handling would be a lot easyere if I knew the processes that where capturede - ex.
Code:
a=`ps -ef|grep <process>|grep -v grep`
number=`echo $a|wc -l`
The last one enables me to view the processes that where captures.
The problem is that last method acturly has an empty line if no processes is captures.
ex
Code:
>ps -ex|grep ThereWillNeverBeAnythingCaptured|grep -v grep|wc -l
>0
>a=`ps -ex|grep ThereWillNeverBeAnythingCaptured|grep -v grep`
>number=`echo $a|wc -l`
>echo $number
>1
I've tryede putting |awk NF but no result.
Any ideers?
Thanks
Lhg