The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 11-27-2008
adhit adhit is offline
Registered User
  
 

Join Date: Apr 2008
Location: Jakarta
Posts: 11
Hi,

please try this
flag=0
touch /tmp/testaja.txt
bdf|awk '{print $5" "$6}'|while read output;
do
persen=$(echo $output |awk -F "%" '{print $1}')
dir=$(echo $output |awk '{print $2}')
if [ $persen -gt 80 ]; then
echo "$dir $persen" >> /tmp/testaja.txt
flag=1
fi
done
if [ $flag -eq 1]; then
mail yourmail@somewhere.com < /tmp/testaja.txt
fi

thanks