Hello !
The command:
Code:
ps -eo %mem,user --sort=user | grep -v MEM | grep -v 68 | sed -e 's/ */:/g'
Give that:
Code:
:0.5:apache
:0.4:apache
:0.0:bigik
:0.0:bigik
:0.0:dbus
:0.0:dovecot
:0.1:haldaemon
:0.0:haldaemon
:0.9:mysql
:1.5:nobody
:0.0:root
:0.0:root
...
And i want the result like that:
Code:
Total Memory Used for apache: XX
Total Memory Used for bigik: XX
...
I'l trying lot of ideas, but nothing work
My last idea:
Code:
for line in `ps -eo %mem,user --sort=user | grep -v MEM | grep -v 68 | sed -e 's/ */:/g'`; do
user=`echo $line|cut -d":" -f2`
valeur=`echo $line|cut -d":" -f3`
tab[$user]+=$valeur
done
dont work.
Have you any idea please ?
Thanks !