[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposed new feature for bash: unbuffered pipes

From: Daniel Colascione
Subject: Re: Proposed new feature for bash: unbuffered pipes
Date: Thu, 23 Apr 2020 17:15:52 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 4/23/20 4:39 PM, Dale R. Worley wrote:
Andreas Schwab <address@hidden> writes:
See stdbuf(1).

The limitation(s) of stdbuf are:  It can only be applied to the standard
I/O streams.  It doesn't affect statically-linked executables.  It only
applies to a single executable, so if the command is a shell function or
script, or creates subprocesses, it doesn't affect them.

If you want to define an environment variable for affecting stdout buffering, you can. (Good luck getting any libc to implement the support you're imagining: libc authors are *very* conservative about everything.) But whether or not you have this environment variable, you don't need special bash syntax to set it: you can just prefix the command you want with an environment variable assignment. I don't think the need you're discussing is widespread enough to warrant further complicating shell syntax.

A much simpler option might be just convincing libc people to make line-buffering the default whether isatty or not. Machines are very fast these days, and any program that _knows_ it's emitting non-line-oriented data can opt into full buffering.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]