From 20cecaa77a496fe86302c76614600160074e584e Mon Sep 17 00:00:00 2001 From: Alexis Ben Miloud--Josselin Date: Thu, 27 Dec 2018 10:34:18 +0100 Subject: [PATCH] Fix line print On the last awk command, line containing "yes" were printed two times. --- kvmstats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kvmstats b/kvmstats index b1d74c2..3b96098 100755 --- a/kvmstats +++ b/kvmstats @@ -57,7 +57,7 @@ do echo "$VM" "$CPU" "$RAM" "$DSK" "$RUN" done | ( echo vm vcpu ram disk running - awk '{ print } /yes$/ { print; vcpu += $2; ram += $3; disk += $4; running++ } END { print "TOTAL(running)", vcpu, ram, disk, running }' + awk '{ print } /yes$/ { vcpu += $2; ram += $3; disk += $4; running++ } END { print "TOTAL(running)", vcpu, ram, disk, running }' if [ "$SHOW_AVAIL" ] then AV_CPU=$(awk '/^processor/ { cpu++ } END { print cpu }' /proc/cpuinfo)