Condense awk command

This commit is contained in:
Dylan Araps 2016-06-13 22:33:34 +10:00
parent 758f883eb9
commit 9f28c025bb

View file

@ -1173,7 +1173,7 @@ getcpu_usage () {
esac esac
fi fi
cpu_usage="$(ps aux | awk 'BEGIN { sum = 0 } { sum += $3 }; END { print sum }')" cpu_usage="$(ps aux | awk 'BEGIN {sum=0} {sum+=$3 }; END {print sum}')"
cpu_usage="$((${cpu_usage/\.*} / ${cores:-1}))" cpu_usage="$((${cpu_usage/\.*} / ${cores:-1}))"
;; ;;
esac esac