[TUHS] sh: cmd | >file

Terry Jones terry at jon.es
Sun Jan 5 08:19:07 AEST 2020


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.

Terry


On Sat, Jan 4, 2020 at 10:40 PM Warner Losh <imp at bsdimp.com> wrote:

>
>
> On Sat, Jan 4, 2020, 3:11 PM Dave Horsfall <dave at horsfall.org> wrote:
>
>> On Sun, 5 Jan 2020, Dave Horsfall wrote:
>>
>> > The Unix philosophy, perhaps i.e. keep it simple?  Why have ":" (an
>> > actual internal Shell command) when "" (the null command) will do the
>> > job?
>>
>> Also, remember that ":" was also used as a comment, before "#" was used.
>>
>
> I thought it was a null label for a goto target... :)
>
> Warner
>
> -- Dave
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20200104/99413523/attachment.html>


More information about the TUHS mailing list