3 ms·
Nice article. See also: https://www.pixelbeat.org/programming/stdio_buffering/ https://www.pixelbeat.org/programming/stdio_buffering/ It's also worth mentionin
by pixelbeat 2y ago
Nice article. See also:
https://www.pixelbeat.org/programming/stdio_buffering/ https://www.pixelbeat.org/programming/stdio_buffering/
It's also worth mentioning a recent improvement we made (in coreutils 8.28) to the operation of the `tail | grep` example in the article. tail now notices if the pipe goes away, so one could wait for something to appear in a log, like:
tail -f /log/file | grep -q match
then_do_something
There are lots of gotchas to pipe handling really.
See also: https://www.pixelbeat.org/programming/sigpipe_handling.html https://www.pixelbeat.org/programming/sigpipe_handling.html