Counting lines and sending emails

view full story

http://www.unix.com – What I am doing is running ps and search for any connection that is over a specified number, I set it to "1" for testing I want to send an email when any of them are over 50 I want them all in one email Below is the code what I want is to display the output of ps and grepping for "httpd" to a single email what it does now is sends an email for each one Code: #!/bin/bash ps aux |grep ftp| grep -v nobody|awk '{$1}  {++P[$1]} END {for(a in P) if (a !="USER") print a,P[a]}'| while read line;do if [ $(echo "$line" | awk '{printf int($2)}') (HowTos)