[TUHS] # (was Re: sh: cmd | >file)

Warner Losh imp at bsdimp.com
Tue Jan 7 10:39:39 AEST 2020


On Mon, Jan 6, 2020 at 3:51 PM Dave Horsfall <dave at horsfall.org> wrote:

> On Mon, 6 Jan 2020, Brian Walden wrote:
>
> > csh(1) was wrtten around 1978 and yes # as a comment was only for
> > scrtipts, think it was why would you need to comment interactively?
>
> Why would you *not* want to?  You've just made "#" asymmetric in its
> behaviour; in the meantime the parser just sees an unescaped "#" and
> ignores everything after that, without regard to context.
>
> You might also be using "script" e.g.
>
>      script
>      blah blah
>      # Now here I do something funky
>      *really* funky stuff
>      ^D
>

Or you might have cut and paste the commands from a script to test
something, or to redo something by hand that failed for some reason.

Warner


> [...]
>
> > Also before you say wait! ALGOL uses # as comment and is older than
> > Kernighan' ratfor(1). [...]
>
> Funny; I recall ALGOL using "comment ... ;" or was that ALGOLW (which I
> loved using; I wish I still had my ALGOLW book)?
>
> -- Dave
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20200106/a8d399b9/attachment.html>


More information about the TUHS mailing list