|
Shell scripting - Adding many numbers in an array
I'd like to know what process is taking how much CPU, so a command like this ; ps waux | grep apache | awk '{print $3}' would give me
the following. However, I need to add those numbers one by one in order to see how much CPU my apache server is spending..
Any ideas? : )
Thanks in advance.
0.0
0.3
0.3
0.3
0.2
0.5
0.6
0.6
0.6
0.6
0.8
0.7
0.8
0.4
0.4
0.4
0.4
0.6
0.3
0.7
0.3
0.6
0.4
0.6
0.1
0.6
0.3
0.2
0.2
0.5
0.6
0.4
0.4
0.5
0.3
0.5
0.4
0.1
0.7
0.2
0.4
0.4
0.2
0.4
0.2
0.6
0.5
0.1
|