Fix line print

On the last awk command, line containing "yes"
were printed two times.
This commit is contained in:
Alexis Ben Miloud--Josselin 2018-12-27 10:34:18 +01:00
parent e12c362f7b
commit 20cecaa77a

View file

@ -57,7 +57,7 @@ do
echo "$VM" "$CPU" "$RAM" "$DSK" "$RUN" echo "$VM" "$CPU" "$RAM" "$DSK" "$RUN"
done | ( done | (
echo vm vcpu ram disk running 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" ] if [ "$SHOW_AVAIL" ]
then then
AV_CPU=$(awk '/^processor/ { cpu++ } END { print cpu }' /proc/cpuinfo) AV_CPU=$(awk '/^processor/ { cpu++ } END { print cpu }' /proc/cpuinfo)