tFixed a useless subshell - monochromatic - monochromatic blog: http://blog.z3bra.org
(HTM) git clone git://z3bra.org/monochromatic
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit 66f9207037c43726a8eb1748909c2ccd5ff1bb8d
(DIR) parent e7be57c54ec3f239c692a152010109ba4ee9d9b8
(HTM) Author: z3bra <willy@mailoo.org>
Date: Wed, 30 Apr 2014 10:58:57 +0200
Fixed a useless subshell
Diffstat:
M 2014/04/meeting-at-the-bar.txt | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
(DIR) diff --git a/2014/04/meeting-at-the-bar.txt b/2014/04/meeting-at-the-bar.txt
t@@ -251,7 +251,7 @@ for pointing out the two digit problem (and other things)
# The whole line goes to bc which outputs the result
LINE=`ps -eo pcpu |grep -vE '^\s*(0.0|%CPU)' |sed -n '1h;$!H;$g;s/\n/ +/gp'`
- echo `bc <<< $LINE`
+ bc <<< $LINE
#### RAM used
t@@ -295,7 +295,7 @@ know exactly how much the applications are taking:
read b c <<< `grep -E '^(Buffers|Cached)' /proc/meminfo |awk '{print $2}'`
# then, calcultate the percentage of memory used
- echo `bc <<< "100($t -$f -$c -$b) / $t"`
+ bc <<< "100($t -$f -$c -$b) / $t"
#### network connection state
t@@ -461,12 +461,12 @@ script, that we will pipe later to our HUD.
cpuload() {
LINE=`ps -eo pcpu |grep -vE '^\s*(0.0|%CPU)' |sed -n '1h;$!H;$g;s/\n/ +/gp'`
- echo `bc <<< $LINE`
+ bc <<< $LINE
}
memused() {
read t f <<< `grep -E 'Mem(Total|Free)' /proc/meminfo |awk '{print $2}'`
- echo `bc <<< "scale=2; 100 - $f / $t * 100" | cut -d. -f1`
+ bc <<< "scale=2; 100 - $f / $t * 100" | cut -d. -f1
}
network() {