Browse Source

Fix line print

On the last awk command, line containing "yes"
were printed two times.
pull/2/head
Alexis Ben Miloud--Josselin 6 months ago
parent
commit
20cecaa77a
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      kvmstats

+ 1
- 1
kvmstats View File

@@ -57,7 +57,7 @@ do
57 57
     echo "$VM" "$CPU" "$RAM" "$DSK" "$RUN"
58 58
 done | (
59 59
     echo vm vcpu ram disk running
60
-    awk '{ print } /yes$/ { print; vcpu += $2; ram += $3; disk += $4; running++ } END { print "TOTAL(running)", vcpu, ram, disk, running }'
60
+    awk '{ print } /yes$/ { vcpu += $2; ram += $3; disk += $4; running++ } END { print "TOTAL(running)", vcpu, ram, disk, running }'
61 61
     if [ "$SHOW_AVAIL" ]
62 62
     then
63 63
         AV_CPU=$(awk '/^processor/ { cpu++ } END { print cpu }' /proc/cpuinfo)

Loading…
Cancel
Save