shellscripting: pipes and output redirection
I'm puzzled.
Please see these simple commands: Code:
# dbus-monitor --system >> /data/eject.txt Code:
# dbus-monitor --system | grep "Eject" Code:
dbus-monitor --system | grep "Eject" >> /data/eject.txt So I tried Code:
dbus-monitor --system | grep "Eject" | tee -a /data/eject.txt As I said ... I am puzzled. I suspect, I missed something elementary here about pipes and redirected output ... |
hmm,
looks OK. first of all check permissions, check disk usage. |
Try to add the option --line-buffered to grep: it forces the output to flush one line at a time. Otherwise the streamed output is flushed after a long time/size and you can't see it in real time.
|
Quote:
Thanks for the exceptional fast help, especially as I would never have suspected good old grep to be the culprit. And my trust in pipes and redirection is restored :-) |
All times are GMT -5. The time now is 11:38 AM. |