I have some usb device (connected to my mac) that produces text output. I use cu with tee to redirect the output to some file:
sudo cu --speed 57600 --line /dev/cu.usbmodem54240287031 | tee cu.log
cu.log looks like:
Sensor data reading ...
SCD30 CO2: 1121
SCD30 Temp: 24.30
SCD30 Humi: 32.59
SGP40 VOC: 30570
SPS30 PM25: 3.91
...
Now I want to put that through a pipe using tail, like this
tail -f cu.log | grep CO2
This works fine. But if I append another step to the pipe it just stops to produce output:
tail -f cu.log | grep CO2| awk '{print $3}'
And I don't know why and how to solve the problem. Can anyone help?