Timeline for What is percent sign prompt in a shell?
Current License: CC BY-SA 4.0
19 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 29, 2024 at 8:48 | history | edited | Stephen Kitt | CC BY-SA 4.0 | Update TUHS mailing list links. |
| May 8, 2022 at 5:55 | history | edited | Kusalananda♦ | CC BY-SA 4.0 | added 15 characters in body |
| Mar 18, 2021 at 0:20 | history | edited | JdeBP | CC BY-SA 4.0 | Have an updated hyperlink. |
| May 3, 2017 at 22:03 | comment | added | Stéphane Chazelas | IIRC, in early Unices, @ was also the kill character (now ^U) and # was erase (now ^H or ^?), so if the early ttys had had the capability to copy-paste, that would have caused interesting behaviours | |
| May 3, 2017 at 21:59 | comment | added | Stéphane Chazelas | It looks like sh in PDP-7 Unix and Unix V1 had @/# before it was changed to %/# (v5 had %, but I didn't find what it was for v2, v3, v4). | |
| May 3, 2017 at 20:46 | comment | added | Stéphane Chazelas | It would be more correct to say Bourne-like than sh-type. The Thomson shell (sh until Unix v6 before it was replaced by the Bourne shell in v7) had %/# as well. I do not know why the Bourne shell changed it to $. Possibly to make it clear to the user that they were getting a different shell from what they would be used to before. Note that # as a comment leader was introduced by csh. The Bourne shell had no comments until much later (you'd use the : null-command as an ersatz). | |
| May 3, 2017 at 20:42 | history | edited | Kusalananda♦ | CC BY-SA 3.0 | deleted 17 characters in body |
| May 3, 2017 at 20:06 | history | edited | Kusalananda♦ | CC BY-SA 3.0 | added 2 characters in body |
| May 3, 2017 at 18:57 | history | edited | Kusalananda♦ | CC BY-SA 3.0 | added 223 characters in body |
| May 3, 2017 at 15:45 | history | edited | Kusalananda♦ | CC BY-SA 3.0 | added 215 characters in body |
| May 3, 2017 at 15:37 | history | edited | Kusalananda♦ | CC BY-SA 3.0 | added 746 characters in body |
| May 3, 2017 at 12:31 | comment | added | Stéphane Chazelas | @HenningMakholm, yes. It originated even before csh introduced # as a comment leader. Still, it's true that #... lines are comments when copy-pasted even if it was not the intention. I don't know if it was the intention behind ; in rc either, though I observe it's a convenient consequence. | |
| May 3, 2017 at 11:59 | comment | added | hmakholm left over Monica | @StéphaneChazelas: Didn't the #-for-root convention originate a long time before terminals where cutting-and-pasting an entire line is easily possible became common? | |
| May 3, 2017 at 9:14 | comment | added | Olivier Dulac | a very important choice of # for root is that if you copy a command including it you will not cause damages (as # starts a comment, so will comment your command (well, its first line)). Some people use ">" and if you copy it as well, it can clobber (empty completely) binaries if the command has a full or relative path or if you are in the right directory (and have sufficient rights, for example if you are root). I have seen this happen. | |
| May 3, 2017 at 8:03 | vote | accept | Max Koretskyi | ||
| May 3, 2017 at 7:25 | comment | added | Stéphane Chazelas | Also note that rc-like shells use ; there (one can copy-paste the full line and that's valid shell code, same idea as root's # prompt being a comment). | |
| May 3, 2017 at 7:23 | history | edited | Kusalananda♦ | CC BY-SA 3.0 | added 188 characters in body |
| May 3, 2017 at 7:22 | comment | added | Stéphane Chazelas | Also in zsh (a Bourne-style shell, but with lots of features from tcsh). Note that Bourne-like and csh-like shells typically use # for users of uid 0. | |
| May 3, 2017 at 7:19 | history | answered | Kusalananda♦ | CC BY-SA 3.0 |