System: MacBook Pro (early 2013), running up-to-date Mojave.
To analyze CPU utilization when an application is running I'm doing the same I've done over and again in a Linux system; running the following command on terminal:
top | grep idle
This works as it should, screen output is:
MacBook:Desktop Peregrino69$ top | grep idle CPU usage: 13.14% user, 15.97% sys, 70.87% idle CPU usage: 10.94% user, 8.53% sys, 80.52% idle CPU usage: 10.95% user, 6.94% sys, 82.9% idle
However if I do
top | grep idle | tee ./utilization.txt
... unexpectedly there's no terminal output at all, and the resulting file is empty. This failing I tried
top | grep idle >> ./utilization.txt
... with the same result.
Testing redirection with a simple echo command
echo hello | tee foo works as expected; the word "hello" outputs both on screen and in foo.
What's going on?