diff --git a/scripts/cpu_collect.sh b/scripts/cpu_collect.sh index 768caba..16546f9 100755 --- a/scripts/cpu_collect.sh +++ b/scripts/cpu_collect.sh @@ -16,7 +16,7 @@ get_cpu_usage() { if is_osx; then if command_exists "iostat"; then iostat -w "$refresh_interval" -c "$samples_count" \ - | stdbuf -o0 awk 'NR > 2 { print 100-$(NF-3); }' + | awk 'NR > 2 { print 100-$(NF-3); fflush(""); }' else top -l "$samples_count" -s "$refresh_interval" -n 0 \ | sed -u -nr '/CPU usage/s/.*,[[:space:]]*([0-9]+[.,][0-9]*)%[[:space:]]*idle.*/\1/p' \