coreutils
[Top][All Lists]
Advanced

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

Re: "tee -" treating "-" as stdout violating POSIX?


From: Pádraig Brady
Subject: Re: "tee -" treating "-" as stdout violating POSIX?
Date: Wed, 18 Feb 2015 23:50:52 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 18/02/15 02:29, Bob Proulx wrote:
> Bernhard Voelker wrote:
>> "tee -" duplicates stdin to stdout (maybe in interleaved order)
>> since v5.2.1-1247-g8dafbe5; this behavior is documented as such.
>>
>> But POSIX explicitly mandates different behavior:
>>
>>   http://pubs.opengroup.org/onlinepubs/9699919799/utilities/tee.html
>>
>>   If a file operand is '-', it shall refer to a file named -;
>>   implementations shall not treat it as meaning standard output.
>>
>> I assume it's too late to revert the behavior to adhere to POSIX
>> rules as it may break existing use cases.
>> Shall we either document that the GNU tee implementation violates
>> POSIX, or should we go for a change to POSIX to allow this (or is
>> there already such a discussion)?
> 
> I don't think the "-" behavior is useful in this case.
> 
> I vote for fixing it as a bug fix.

It's one of those borderline ones.
Given no-one has complained, I think there is a
greater chance that someone is relying on the current behavior.
There are already lots of gotchas with a file named '-',
so I wouldn't be on for change to support that.

Pádraig.




reply via email to

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