[TUHS] sh: cmd | >file

Eric Allman tuhs at eric.allman.name
Sun Jan 5 10:03:26 AEST 2020


I contacted Steve --- he is on the list, and says he'll weigh in.

eric


On 2020-01-04 13:06, Jon Steinhart wrote:
> Dave Horsfall writes:
>> On Sat, 4 Jan 2020, markus schnalke wrote:
>>
>>> My question was not about the use cases for ``>file'' but *why* it was
>>> made a simple command. Let me explain:
>>>
>>> One creates an empty file or truncates a file with:
>>>
>>> 	>file
>>>
>>> why not with:
>>>
>>> 	:>file
>>> ?
>>>
>>> To me it looks to be the more sensible ... more regular way.
>>
>> The Unix philosophy, perhaps i.e. keep it simple?  Why have ":" (an actual
>> internal Shell command) when "" (the null command) will do the job?
>>
>> I guess only the Bell Labs bods here can answer this.
>>
>> -- Dave
> 
> Don't know if Steve Bourne is on this list, but he's been a great source
> of information when I've had questions about why the shell did things the
> way it did.
> 
> Jon
> 


More information about the TUHS mailing list