On 19/02/15 00:53, Bernhard Voelker wrote:
> On 02/19/2015 01:34 AM, Eric Blake wrote:
>> But I'm still 60:40 in favor of fixing it as
>> a bug fix, for consistency with other POSIX implementations.
> 
> Furthermore, what would be the alternative?
> 
> It is clear now that GNU tee violates an explicitly mentioned
> aspect in the POSIX specification ... without proper documenting
> it.  To summarize, these are our options:
> a) leave as is.
> b) guard deviating behavior by POSIXLY_CORRECT.
> c) revert the special-casing of "-" as meaning stdout.
> d) improve documentation and state why GNU tee consciously
>    violates an explicit POSIX rule.
> 
> a) is lame, b) was already considered suboptimal, and for d)
> I don't see much other argument than "it's like it is - although
> it's probably not useful".
> Therefore, I'd personally also vote for c).
> 
> If there are some odd scripts out there relying on this,
> then it might not be hard to fix, e.g. (for text files):
> 
>   - ... | tee - | ...
>   + ... | sed p | ...
> or
>   - ... | tee out1 - out2 > out3
>   + ... | tee out1 >(sed p > out3) > out2
> 
> Attached is a patch to talk about.
> 
> BTW: tee(1) seems to be the only coreutils utility which
> accepts "-" as stdout, isn't it?

shred, and touch also, at least.
BTW there is a separate tee-dash test.

I'm worried about breaking scripts that do stuff like:

  tee file - >/dev/null

cheers,
Pádraig


Reply via email to