[TUHS] sh: cmd | >file

Dave Horsfall dave at horsfall.org
Sun Jan 5 07:02:08 AEST 2020


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


More information about the TUHS mailing list