We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6a0d43b + 760fe8a commit fa2e59bCopy full SHA for fa2e59b
scripts/cpu_info.sh
@@ -9,7 +9,7 @@ get_percent()
9
{
10
case $(uname -s) in
11
Linux)
12
- percent=$(LC_NUMERIC=en_US.UTF-8 top -bn2 -d 0.01 | grep "Cpu(s)" | tail -1 | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1"%"}')
+ percent=$(LC_NUMERIC=en_US.UTF-8 top -bn2 -d 0.01 | grep "[C]pu(s)" | tail -1 | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1"%"}')
13
normalize_percent_len $percent
14
;;
15
0 commit comments