Sample Header Ad - 728x90

*nix shell: How to disable pipe buffering for ALL pipes in a command?

1 vote
1 answer
522 views
I want *every* pipe to be unbuffered, so I don't have to type stdbuf -oL for every piped command. When concocting commands with multiple pipes, it would be nice if there was a environment variable or something to enable it globally or at least for the remainder of the pipes in the command. Yes I know about unbuffer and stdbuf but they need to be invoked for every pipe... I'm trying to save typing because I do this often. Something like: before:
stdbuf -oL command_1 | stdbuf -oL command_2 | stdbuf -oL command_3
after:
BUFFERING=-oL command_1 | command_2 | command_3
Asked by Aaron Frantisak (111 rep)
Jun 23, 2022, 11:22 PM
Last activity: Aug 9, 2022, 11:07 PM