Hello, any idea about why below script is not working?
The final sum is empty..

#!/usr/local/bin/bash

for user in `ps -A -o user | sort | uniq | tail +2`
 do
        echo "user: $user"

   ps aux -U $user | tail +2 | while read line
   do

    mem=`echo $line | awk {'print $4'}`
        echo "mem: $mem"
        TMPSUMMEM=`awk -v x=$mem -v y=$TMPSUMMEM 'BEGIN{printf
"%.2f\n",x+y}'`
        echo "summem: $TMPSUMMEM"
   done
        echo "finalsummem: $SUMMEM"
 [EMAIL PROTECTED]


      
____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to