Skip to content

Conversation

jgeraerts
Copy link

stdbuf is not available on osx so flush the output using fflush in awk.

stdbuf is not available on osx so flush the output using fflush in awk.
@@ -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(""); }'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgeraerts fix problem on M1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants