Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.misc > #32990
| From | Eli the Bearded <*@eli.users.panix.com> |
|---|---|
| Newsgroups | comp.os.linux.misc |
| Subject | Re: Why are hyperlinks blue? |
| Date | 2021-08-29 21:44 +0000 |
| Organization | Some absurd concept |
| Message-ID | <eli$2108291744@qaz.wtf> (permalink) |
| References | <sg9pff$17a$1@gioia.aioe.org> <m7ipvhxbkm.ln2@minas-tirith.valinor> <sgf1vt$g89$1@dont-email.me> <sgfdtm$ich$1@dont-email.me> |
In comp.os.linux.misc, The Natural Philosopher <tnp@invalid.invalid> wrote: > On 29/08/2021 05:21, Rich wrote: >> Another possibility (for the Python specific question) is that Python >> simply copied the Unix shell's comment character, which is also a #. Yeah, # was a common choice of comment character before Python existed, so need to look back before Python. >> But then that just moves the question back to: Why do Unix shell >> comments begin with a "#"? > Why not? :r! stty -a |grep erase -echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo erase = ^?; intr = ^C; kill = ^U; lnext = ^V; min = 1; quit = ^\; time = 0; werase = ^W; These days erase defaults to del (^?) or backspace (^H), but I can remember a time when it defaulted to #, and using your backspace character as a comment indicator makes it hard to add comments. My 1988 copy of _The Unix Operating System_ (second edition) by Kaare Christian shows defaults (page 98) erase = #, kill = @, intr = ^? (I remember seeing that kill thing also interfere with use of @ in passwords.) The book does not show the default for lnext, which is what you'd need to type to escape the special meaning of # or @ to use it in comments. There's an explanation that you can use # for comments in shell scripts (p195), but no explaination for why in that book. For reference, first release of Python was 1991. First release of Perl, which also uses # for comments, is 1988. Looking around I see a 1967 doc for BCPL using // for comments, very c++ ish: https://www.bell-labs.com/usr/dmr/www/bcpl.pdf The Unix Seventh Edition man pages, in *roff format which I can read fine but..., are here: https://s3.amazonaws.com/plan9-bell-labs/7thEdMan/index.html I see that awk uses # for comments, but shell shows : for comments. These days, in sh the : command is a substitute for /bin/true. It works like a no-op command, which is subtly different from a comment: #!/bin/sh #this is a comment :this will like produce ":this: command not found" # the following does nothing # > /etc/passwd : the following will produce an error or destroy your system : > /etc/password : moral: don't run stuff as root # oops, no closing quote! https://s3.amazonaws.com/plan9-bell-labs/7thEdMan/vol2/awk.txt .ND "September 1, 1978" https://s3.amazonaws.com/plan9-bell-labs/7thEdMan/vol2/shell.bun.txt .ds DA 1977 November 1 No stty manpage there to look for control character defaults. Erase, kill, etc, might not have made sense in early ASR-33 days. I wasn't there and don't know. BUT probably: Larry Wall probably used # for comments in Perl because AWK used # for comments. Guido van Rossum likely used # for comments because languages like AWK and Perl used # for comments. Elijah ------ carefully uses : for embeded vi commands in shell scripts sometimes
Back to comp.os.linux.misc | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Why are hyperlinks blue? "Andrei Z." <no-email@invalid.invalid> - 2021-08-27 07:25 +0300
Re: Why are hyperlinks blue? not@telling.you.invalid (Computer Nerd Kev) - 2021-08-28 05:31 +0000
Re: Why are hyperlinks blue? SixOverFive <hae274c.net> - 2021-08-28 01:32 -0400
Re: Why are hyperlinks blue? The Natural Philosopher <tnp@invalid.invalid> - 2021-08-28 09:10 +0100
Re: Why are hyperlinks blue? "Carlos E. R." <robin_listas@es.invalid> - 2021-08-28 13:11 +0200
Re: Why are hyperlinks blue? Rich <rich@example.invalid> - 2021-08-29 04:21 +0000
Re: Why are hyperlinks blue? The Natural Philosopher <tnp@invalid.invalid> - 2021-08-29 08:44 +0100
Re: Why are hyperlinks blue? Eli the Bearded <*@eli.users.panix.com> - 2021-08-29 21:44 +0000
Re: Why are hyperlinks blue? Richard Kettlewell <invalid@invalid.invalid> - 2021-08-31 20:43 +0100
Re: Why are hyperlinks blue? Aragorn <thorongil@telenet.be> - 2021-08-29 16:43 +0200
Re: Why are hyperlinks blue? Richard Kettlewell <invalid@invalid.invalid> - 2021-08-30 08:08 +0100
csiph-web