[TUHS] sh: cmd | >file

Chet Ramey chet.ramey at case.edu
Sun Jan 5 08:33:56 AEST 2020


On 1/4/20 5:19 PM, Terry Jones wrote:
> Was : actually designed for commenting?  If so, at what point did it become
> a command that always returns zero exit status?  Was it always built-in, or
> did it originally have a separate filesystem existence (like "[")? Python
> has a useful "pass" command, but : is much nicer because you can "comment"
> out a single command in (e.g.) an if/then and it remains syntactically
> valid and executable. I find it very elegant.

It's elegant until you forget that `:' continues to process redirections.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet at case.edu    http://tiswww.cwru.edu/~chet/


More information about the TUHS mailing list