[Top][All Lists]

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

Re: Possible bug with grep/sed/tail?

From: Jim Meyering
Subject: Re: Possible bug with grep/sed/tail?
Date: Tue, 25 Nov 2008 12:02:07 +0100

Pádraig Brady <address@hidden> wrote:
> Jim Meyering wrote:
>> Pádraig Brady <address@hidden> wrote:
>>> I'm now thinking of 3 options: stdbuf -i -o -e
>>> The usual use case is: stdbuf -ol
>>> But you could also do: stdbuf -i4096 -o8192
>>> We would warn about redundant combos like: stdbuf -il
>> So -ol (that's an el) would mean line-buffered stdout?
>> That has to be equivalent to -o -l
> Note -o would require an arg so it's unambiguous.
> It's like `ls -w2` working and `ls -w -2` giving an error.

Oh, then yes, that'd work.

> Perhaps it's a policy for lower case parameters
> in case -l would ever be needed in future?
> In that case would requiring a capital L as a parameter suffice?
>> , and unless you consider
>> ordering and multiple -l options (e.g., "-i -l -o -l" is ugly),
>> then it doesn't let you line-buffer more than one of the three streams.
>> How about making -i -o -e mean line-buffered (--input --output --error),
>> and -I N -O N -E N specify the less-common cases of no buffering
>> or an N-byte buffer size? (--i-buf=N --o-buf=N --e-buf=N)
> I'm conscious of making the modifier as unobtrusive as possible.
> If we really need to use long options then could we just use:
> stdbuf --o=L
> stdbuf --i=4096 --o=8192

Good idea to use capital 'L'.
Please provide both short and long options.
The usual --help would look something like this:

  -i, --input=L_or_SIZE  ...description...
  -o, --ouput=L_or_SIZE  ...
  -e, --error=L_or_SIZE  ...

Then you can use any of -i L, -iL, or --input=L

reply via email to

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