The cpu-usage percentage is shown as empty string.
The reason for this is that the script cpu_usage.sh is using LC_NUMERIC=en_US.UTF-8 top -bn2 -d 0.01 | grep "Cpu(s)" which outputs an empty string for me. top seems to display CPU(s) for me instead of Cpu(s). Changing it to grep -i "Cpu(s)" to ignore the cases here worked for me.
To Reproduce
I actually don't know how to reproduce this as i don't know why top is doing this.
Hm yeah I remember this being an issue. I could have sworn we had something that fixed it though. If you want to send in a PR fixing this, I'll merge it.
Describe the bug
The cpu-usage percentage is shown as empty string. The reason for this is that the script
cpu_usage.sh
is usingLC_NUMERIC=en_US.UTF-8 top -bn2 -d 0.01 | grep "Cpu(s)"
which outputs an empty string for me.top
seems to displayCPU(s)
for me instead ofCpu(s)
. Changing it togrep -i "Cpu(s)"
to ignore the cases here worked for me.To Reproduce
I actually don't know how to reproduce this as i don't know why
top
is doing this.Expected behavior
Display the CPU usage in percentages.
System