monochromatic blog:
git clone git://
Log | Files | Refs

commit a4aec222b8ea914778a68161ed8debf383599753
parent bbb680b4d16c783a987f654eb93ccdf9ef27417e
Author: z3bra <>
Date:   Wed, 30 Apr 2014 11:21:52 +0200

Added an awk alternative. Thanks to verkgw

2014/04/meeting-at-the-bar.txt | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/2014/04/meeting-at-the-bar.txt b/2014/04/meeting-at-the-bar.txt @@ -253,6 +253,12 @@ for pointing out the two digit problem (and other things) LINE=`ps -eo pcpu |grep -vE '^\s*(0.0|%CPU)' |sed -n '1h;$!H;$g;s/\n/ +/gp'` bc <<< $LINE +**NOTE**: *verkgw* on proposed a faster `awk` alternative. +I don't know awk enough to come up with this kind of line, so I'll just continue +with `grep` and `sed`. See the comparison [here]( + + ps -eo pcpu | awk 'BEGIN {sum=0.0f} {sum+=$1} END {print sum}' + #### RAM used To display RAM usage (percentage of RAM actually by the system), we will use