The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* Re: [TUHS] Origins of shell prompt suffixes % $ > #
@ 2018-08-08 15:20 Noel Chiappa
  2018-08-08 16:01 ` Gilles Gravier
  0 siblings, 1 reply; 32+ messages in thread
From: Noel Chiappa @ 2018-08-08 15:20 UTC (permalink / raw)
  To: tuhs; +Cc: jnc

    > From: Nemo

    > I will, no doubt, be flayed on this list but I tend to use "=>".

Hey, if it works for you, go for it.

After the Nth time I got confused as to exactly which machine I was
typing to, I hacked the shell on my V6 Unix to read its prompt from
".profile". (Very clean, only one added line of code in the existing
code.)

	Noel

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-08 15:20 [TUHS] Origins of shell prompt suffixes % $ > # Noel Chiappa
@ 2018-08-08 16:01 ` Gilles Gravier
  2018-08-08 20:29   ` ron
                     ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Gilles Gravier @ 2018-08-08 16:01 UTC (permalink / raw)
  To: TUHS

[-- Attachment #1: Type: text/plain, Size: 803 bytes --]

Caveat emptor: I haven't read all the messages on this thread. :)

But... I remember the VMS prompt being "$"... maybe some ancestry since VMS
dates back to 1970?

Gilles

2018-08-08 17:20 GMT+02:00 Noel Chiappa <jnc@mercury.lcs.mit.edu>:

>     > From: Nemo
>
>     > I will, no doubt, be flayed on this list but I tend to use "=>".
>
> Hey, if it works for you, go for it.
>
> After the Nth time I got confused as to exactly which machine I was
> typing to, I hacked the shell on my V6 Unix to read its prompt from
> ".profile". (Very clean, only one added line of code in the existing
> code.)
>
>         Noel
>



-- 
*Gilles Gravier*  - Gilles@Gravier.org
GSM : +33618347147 and +41794728437
Skype : ggravier | PGP Key : 0x8DE6D026
<http://pgp.mit.edu:11371/pks/lookup?search=0x8DE6D026&op=index>

[-- Attachment #2: Type: text/html, Size: 2494 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-08 16:01 ` Gilles Gravier
@ 2018-08-08 20:29   ` ron
  2018-08-08 20:30   ` Clem Cole
  2018-08-09  2:50   ` William Corcoran
  2 siblings, 0 replies; 32+ messages in thread
From: ron @ 2018-08-08 20:29 UTC (permalink / raw)
  To: 'Gilles Gravier', 'TUHS'

[-- Attachment #1: Type: text/plain, Size: 384 bytes --]

*	But... I remember the VMS prompt being "$"... maybe some ancestry since VMS dates back to 1970?

 

VMS development started in 1975.   It didn’t see the light of day until the VAX hardware was released in 1977.

 


RSX used > (sometimes MCR>).

TOPS-10 used a period (.) at the monitor level and asterisk at the user level.

RT-11 also used the period.

 

 


[-- Attachment #2: Type: text/html, Size: 5082 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-08 16:01 ` Gilles Gravier
  2018-08-08 20:29   ` ron
@ 2018-08-08 20:30   ` Clem Cole
  2018-08-08 20:51     ` Warner Losh
  2018-08-09  2:50   ` William Corcoran
  2 siblings, 1 reply; 32+ messages in thread
From: Clem Cole @ 2018-08-08 20:30 UTC (permalink / raw)
  To: Gilles Gravier; +Cc: TUHS

[-- Attachment #1: Type: text/plain, Size: 960 bytes --]

On Wed, Aug 8, 2018 at 12:01 PM, Gilles Gravier <gilles@gravier.org> wrote:

> Caveat emptor: I haven't read all the messages on this thread. :)
>
> But... I remember the VMS prompt being "$"... maybe some ancestry since
> VMS dates back to 1970
>
Be careful .. VMS 1.0 was released in the late 1970s, we had Vax serial #1
at CMU - I want to say 1976 or 77.  Dave's Command Language (DCL - renamed
DEC Command Language by DEC marketing) was originally part of an earlier
RSX and yes used $ as the prompt.

But numerous systems used $ and many of the other punctuation chars as a
prompt.

We'll have to ask srb, but I'm fair confident in stating VMS had no bearing
on his choice of a command prompt (I'm fairly sure VMS was not release by
the time he came to the Labs).   I would have expected if it was taking it
from another system (which is possible) it would have been on the British
ones in use at Cambridge before he came to BTL.
ᐧ

[-- Attachment #2: Type: text/html, Size: 2092 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-08 20:30   ` Clem Cole
@ 2018-08-08 20:51     ` Warner Losh
  0 siblings, 0 replies; 32+ messages in thread
From: Warner Losh @ 2018-08-08 20:51 UTC (permalink / raw)
  To: Clem Cole; +Cc: TUHS main list

[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]

On Wed, Aug 8, 2018, 2:31 PM Clem Cole <clemc@ccc.com> wrote:

>
>
> On Wed, Aug 8, 2018 at 12:01 PM, Gilles Gravier <gilles@gravier.org>
> wrote:
>
>> Caveat emptor: I haven't read all the messages on this thread. :)
>>
>> But... I remember the VMS prompt being "$"... maybe some ancestry since
>> VMS dates back to 1970
>>
> Be careful .. VMS 1.0 was released in the late 1970s, we had Vax serial #1
> at CMU - I want to say 1976 or 77.  Dave's Command Language (DCL - renamed
> DEC Command Language by DEC marketing) was originally part of an earlier
> RSX and yes used $ as the prompt.
>
> But numerous systems used $ and many of the other punctuation chars as a
> prompt.
>
> We'll have to ask srb, but I'm fair confident in stating VMS had no
> bearing on his choice of a command prompt (I'm fairly sure VMS was not
> release by the time he came to the Labs).   I would have expected if it was
> taking it from another system (which is possible) it would have been on the
> British ones in use at Cambridge before he came to BTL.
>

TOPS-20 used @. RSTS/E used Ready.

Warner

> ᐧ
>

[-- Attachment #2: Type: text/html, Size: 2729 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-08 16:01 ` Gilles Gravier
  2018-08-08 20:29   ` ron
  2018-08-08 20:30   ` Clem Cole
@ 2018-08-09  2:50   ` William Corcoran
  2 siblings, 0 replies; 32+ messages in thread
From: William Corcoran @ 2018-08-09  2:50 UTC (permalink / raw)
  To: Gilles Gravier; +Cc: TUHS

[-- Attachment #1: Type: text/plain, Size: 1215 bytes --]

I too have not seen all of the messages on this thread.

I always thought the $ was used for the shell prompt as a persistent reminder that time on the system costs money: As process accounting will assist in your monthly billing.

Bill Corcoran

On Aug 8, 2018, at 4:20 PM, Gilles Gravier <gilles@gravier.org<mailto:gilles@gravier.org>> wrote:

Caveat emptor: I haven't read all the messages on this thread. :)

But... I remember the VMS prompt being "$"... maybe some ancestry since VMS dates back to 1970?

Gilles

2018-08-08 17:20 GMT+02:00 Noel Chiappa <jnc@mercury.lcs.mit.edu<mailto:jnc@mercury.lcs.mit.edu>>:
    > From: Nemo

    > I will, no doubt, be flayed on this list but I tend to use "=>".

Hey, if it works for you, go for it.

After the Nth time I got confused as to exactly which machine I was
typing to, I hacked the shell on my V6 Unix to read its prompt from
".profile". (Very clean, only one added line of code in the existing
code.)

        Noel



--
Gilles Gravier  - Gilles@Gravier.org<mailto:Gilles@Gravier.org>
GSM : +33618347147 and +41794728437
Skype : ggravier | PGP Key : 0x8DE6D026<http://pgp.mit.edu:11371/pks/lookup?search=0x8DE6D026&op=index>

[-- Attachment #2: Type: text/html, Size: 3281 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07  8:02   ` Michael Kjörling
                       ` (2 preceding siblings ...)
  2018-08-07 11:24     ` Pete Turnbull
@ 2018-08-08 19:55     ` Derek Fawcus
  3 siblings, 0 replies; 32+ messages in thread
From: Derek Fawcus @ 2018-08-08 19:55 UTC (permalink / raw)
  To: tuhs

On Tue, Aug 07, 2018 at 08:02:56AM +0000, Michael Kjörling wrote:
> I suspect I must stand corrected on this. Turns out that at least GNU
> bash 4.4.12(1) seems to not like a `;` at the beginning of the command
> line.

I can't recall where I got this from, but I tend to use the following
on bourne style shells; bash (and others) seem happy with it for copy/paste:

h=copper$; tty
/dev/pts/0
h=copper$; h=copper$; tty
/dev/pts/0

h=copper#; tty
/dev/pts/0
h=copper#; h=copper#; tty
/dev/pts/0

'copper' being the hostname, $/# as per usual.

DF

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-08 14:38       ` Nemo
@ 2018-08-08 14:51         ` Clem Cole
  0 siblings, 0 replies; 32+ messages in thread
From: Clem Cole @ 2018-08-08 14:51 UTC (permalink / raw)
  To: Nemo; +Cc: TUHS main list

[-- Attachment #1: Type: text/plain, Size: 250 bytes --]

On Wed, Aug 8, 2018 at 10:38 AM, Nemo <cym224@gmail.com> wrote:

>
> I will, no doubt, be flayed on this list but I tend to use "=> ".

Remember: "Hacking is what is done in the privacy of your own office;
between you and your terminal."
ᐧ

[-- Attachment #2: Type: text/html, Size: 1142 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07 10:45     ` Tony Finch
  2018-08-07 17:35       ` Lyndon Nerenberg
@ 2018-08-08 14:38       ` Nemo
  2018-08-08 14:51         ` Clem Cole
  1 sibling, 1 reply; 32+ messages in thread
From: Nemo @ 2018-08-08 14:38 UTC (permalink / raw)
  To: tuhs

On 07/08/2018, Tony Finch <dot@dotat.at> wrote:
> Michael Kjörling <michael@kjorling.se> wrote:
>>
>> I suspect I must stand corrected on this. Turns out that at least GNU
>> bash 4.4.12(1) seems to not like a `;` at the beginning of the command
>> line.
>
> This is a consequence of the POSIX shell grammar, which doesn't allow
> empty commands.
>
> http://pubs.opengroup.org/onlinepubs/9699919799.2013edition/utilities/V3_chap02.html#tag_18_10

Good point (and [t]csh on Solaris does not care).

> prompt I have used since about 1997 (and I can't remember where I got
> it from - somewhere on Usenet, probably) in its most distilled form is
>
> :;

I will, no doubt, be flayed on this list but I tend to use "=> ".

N.

>
> although in practice I have a load of extra fluff for username, hostname,
> CWD, etc. usw.
>
> Tony.
> --
> f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
> Fair Isle, Faeroes: South or southwest 4 or 5, occasionally 6 for a time.
> Slight or moderate, occasionally rough for a time. Showers. Moderate or
> good.
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07 19:00         ` Cág
@ 2018-08-07 19:06           ` Brian Zick
  0 siblings, 0 replies; 32+ messages in thread
From: Brian Zick @ 2018-08-07 19:06 UTC (permalink / raw)
  To: tuhs

On Tue, Aug 7, 2018, at 8:00 PM, Cág wrote:
> arnold wrote:
> 
> > Brian was referring to rc(1) in NetBSD.  I suspect it's Byron's rc
> > and I think the default there is ';'.
> 
> rc is not shipped with NetBSD. There's Byron's rc in pkgsrc, so it could
> be that.

Yes, I was referring to the rc in pkgsrc.

B



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07 18:51       ` arnold
@ 2018-08-07 19:00         ` Cág
  2018-08-07 19:06           ` Brian Zick
  0 siblings, 1 reply; 32+ messages in thread
From: Cág @ 2018-08-07 19:00 UTC (permalink / raw)
  To: tuhs

arnold wrote:

> Brian was referring to rc(1) in NetBSD.  I suspect it's Byron's rc
> and I think the default there is ';'.

rc is not shipped with NetBSD. There's Byron's rc in pkgsrc, so it could
be that.

--
caóc


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07 18:09     ` Cág
@ 2018-08-07 18:51       ` arnold
  2018-08-07 19:00         ` Cág
  0 siblings, 1 reply; 32+ messages in thread
From: arnold @ 2018-08-07 18:51 UTC (permalink / raw)
  To: tuhs, ca6c

C??g <ca6c@bitmessage.ch> wrote:

> Brian Zick wrote:
>
> > In NetBSD 7 the default is ';', but I don't see any reference to a
> > default $prompt in the manual on that system.
>
> It's not. '$' is default for sh and ksh, and '%' for csh. I think
> it maybe has never been ';'.
>
> --
> ca??c
>

Brian was referring to rc(1) in NetBSD.  I suspect it's Byron's rc
and I think the default there is ';'.

Arnold

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07 15:15   ` Brian Zick
  2018-08-07 15:52     ` John P. Linderman
@ 2018-08-07 18:09     ` Cág
  2018-08-07 18:51       ` arnold
  1 sibling, 1 reply; 32+ messages in thread
From: Cág @ 2018-08-07 18:09 UTC (permalink / raw)
  To: tuhs

Brian Zick wrote:

> In NetBSD 7 the default is ';', but I don't see any reference to a
> default $prompt in the manual on that system.

It's not. '$' is default for sh and ksh, and '%' for csh. I think
it maybe has never been ';'.

--
caóc


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07 10:45     ` Tony Finch
@ 2018-08-07 17:35       ` Lyndon Nerenberg
  2018-08-08 14:38       ` Nemo
  1 sibling, 0 replies; 32+ messages in thread
From: Lyndon Nerenberg @ 2018-08-07 17:35 UTC (permalink / raw)
  To: Tony Finch; +Cc: tuhs

> The prompt I have used since about 1997 (and I can't remember where I got
> it from - somewhere on Usenet, probably) in its most distilled form is
>
> :;

I forget where I stole this from. It lives in $home/lib/profile on my 
Plan9 machines:

# /n/sources/contrib/lyndon/prompt.rc
fn : {}
fn setprompt {
         prompt = (': '^`{cat /dev/user}^@^`{cat /dev/sysname}^':'^`{pwd}^'; '  '        ')
}
fn cd { builtin cd $* && setprompt }
setprompt


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07 15:15   ` Brian Zick
@ 2018-08-07 15:52     ` John P. Linderman
  2018-08-07 18:09     ` Cág
  1 sibling, 0 replies; 32+ messages in thread
From: John P. Linderman @ 2018-08-07 15:52 UTC (permalink / raw)
  To: Brian Zick; +Cc: tuhs

[-- Attachment #1: Type: text/plain, Size: 858 bytes --]

On vacation, with just an iPad keyboard, so I apologize for not doing more
digging.  As I noted, when taking the blame for the Great Echo Schism, my
early exposure to a hp2640 terminal that allowed “rentry” of a previous
command was partly to blame. It also led me to use a PS1 ending in @, the
default line-kill. When I reentered a command, the @ wiped out the prompt
stuff, and only the command survived.

On Tue, Aug 7, 2018 at 10:15 AM Brian Zick <brian@zick.io> wrote:

> > > rc uses ;
> >
> > Does it?  10th edition Unix and Plan 9 rc both have ('% ' ' ') as the
> > default value of $prompt.  At least that's how it's described in the
> > manual.
>
> In NetBSD 7 the default is ';', but I don't see any reference to a default
> $prompt in the manual on that system. I wonder if this was a change unique
> to Berkeley.
>
> B
>

[-- Attachment #2: Type: text/html, Size: 1195 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07  7:31 ` Kurt H Maier
  2018-08-07  7:50   ` arnold
  2018-08-07  7:57   ` Bakul Shah
@ 2018-08-07 15:15   ` Brian Zick
  2018-08-07 15:52     ` John P. Linderman
  2018-08-07 18:09     ` Cág
  2 siblings, 2 replies; 32+ messages in thread
From: Brian Zick @ 2018-08-07 15:15 UTC (permalink / raw)
  To: Kurt H Maier; +Cc: tuhs

> > rc uses ;
>        
> Does it?  10th edition Unix and Plan 9 rc both have ('% ' ' ') as the   
> default value of $prompt.  At least that's how it's described in the
> manual. 

In NetBSD 7 the default is ';', but I don't see any reference to a default $prompt in the manual on that system. I wonder if this was a change unique to Berkeley.

B

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
@ 2018-08-07 12:34 Doug McIlroy
  0 siblings, 0 replies; 32+ messages in thread
From: Doug McIlroy @ 2018-08-07 12:34 UTC (permalink / raw)
  To: tuhs

> The Bourne shell (V7) had setable PS1 (start of command) and PS2 (continuation prompts)

When PS2 came on the scene, Bob Morris noticed that it most often appeared
because of a missing close quote. Therefore he set PS2="hit interrupt".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07  8:02   ` Michael Kjörling
  2018-08-07  8:23     ` Dave Horsfall
  2018-08-07 10:45     ` Tony Finch
@ 2018-08-07 11:24     ` Pete Turnbull
  2018-08-08 19:55     ` Derek Fawcus
  3 siblings, 0 replies; 32+ messages in thread
From: Pete Turnbull @ 2018-08-07 11:24 UTC (permalink / raw)
  To: tuhs

On 07/08/2018 09:02, Michael Kjörling wrote:
> On 7 Aug 2018 06:54 +0000, from michael@kjorling.se (Michael Kjörling):
>> the shell will do The Right Thing (tm)
> 
> I suspect I must stand corrected on this. Turns out that at least GNU
> bash 4.4.12(1) seems to not like a `;` at the beginning of the command
> line.
> 
>      $ /bin/bash --version | head -n1
>      GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)
>      $ /bin/bash
>      $ ; true
>      bash: syntax error near unexpected token `;'
>      $ echo $?
>      2
>      $
> 
> Hopefully other shells are more sane.

ksh and sh on an IRIX system don't like it either:

$ ;
ksh: syntax error: `;' unexpected
$

csh and tcsh don't mind.

Of course it works in rc itself, which is the point, really, and I 
wonder how often anyone pasted from one shell into another.  All the rc 
use I've seen did indeed use "; " as the prompt, but that was all at the 
University of York, starting in 1993.

-- 
Pete
Pete Turnbull

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07  8:02   ` Michael Kjörling
  2018-08-07  8:23     ` Dave Horsfall
@ 2018-08-07 10:45     ` Tony Finch
  2018-08-07 17:35       ` Lyndon Nerenberg
  2018-08-08 14:38       ` Nemo
  2018-08-07 11:24     ` Pete Turnbull
  2018-08-08 19:55     ` Derek Fawcus
  3 siblings, 2 replies; 32+ messages in thread
From: Tony Finch @ 2018-08-07 10:45 UTC (permalink / raw)
  To: Michael Kjörling; +Cc: tuhs

[-- Attachment #1: Type: text/plain, Size: 864 bytes --]

Michael Kjörling <michael@kjorling.se> wrote:
>
> I suspect I must stand corrected on this. Turns out that at least GNU
> bash 4.4.12(1) seems to not like a `;` at the beginning of the command
> line.

This is a consequence of the POSIX shell grammar, which doesn't allow
empty commands.

http://pubs.opengroup.org/onlinepubs/9699919799.2013edition/utilities/V3_chap02.html#tag_18_10

The prompt I have used since about 1997 (and I can't remember where I got
it from - somewhere on Usenet, probably) in its most distilled form is

:;

although in practice I have a load of extra fluff for username, hostname,
CWD, etc. usw.

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
Fair Isle, Faeroes: South or southwest 4 or 5, occasionally 6 for a time.
Slight or moderate, occasionally rough for a time. Showers. Moderate or good.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07  8:23     ` Dave Horsfall
@ 2018-08-07  8:37       ` KatolaZ
  0 siblings, 0 replies; 32+ messages in thread
From: KatolaZ @ 2018-08-07  8:37 UTC (permalink / raw)
  To: tuhs

[-- Attachment #1: Type: text/plain, Size: 1185 bytes --]

On Tue, Aug 07, 2018 at 06:23:37PM +1000, Dave Horsfall wrote:
> On Tue, 7 Aug 2018, Michael Kjörling wrote:
> 
> > Hopefully other shells are more sane.
> 
> The MacBook here runs GNU bash, version 3.2.57(1)-release
> (x86_64-apple-darwin16) and is equally busted, as is plain "sh" on both the
> Mac and FreeBSD (I can't be bothered checking the Penguin); I use ZSH on
> FreeBSD and it does The Right Thing (tm), as does ZSH on the Mac.
> 
> -- Dave

I have tried all the shells I have on my linux box. It turns out that
only ksh and zsh like a ";" at the beginning of the line. Otherwise,
bash, busybox, ash/dash, mksk, posh, and yash can't bear it.

I really don't see the point of using ";", especially if you need to
make it clear if a command needs to be run by root.

$ ;-P
sh: 1: Syntax error: ";" unexpected


-- 
[ ~.,_  Enzo Nicosia aka KatolaZ - Devuan -- Freaknet Medialab  ]  
[     "+.  katolaz [at] freaknet.org --- katolaz [at] yahoo.it  ]
[       @)   http://kalos.mine.nu ---  Devuan GNU + Linux User  ]
[     @@)  http://maths.qmul.ac.uk/~vnicosia --  GPG: 0B5F062F  ] 
[ (@@@)  Twitter: @KatolaZ - skype: katolaz -- github: KatolaZ  ]

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07  8:02   ` Michael Kjörling
@ 2018-08-07  8:23     ` Dave Horsfall
  2018-08-07  8:37       ` KatolaZ
  2018-08-07 10:45     ` Tony Finch
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 32+ messages in thread
From: Dave Horsfall @ 2018-08-07  8:23 UTC (permalink / raw)
  To: The Eunuchs Hysterical Society

[-- Attachment #1: Type: text/plain, Size: 371 bytes --]

On Tue, 7 Aug 2018, Michael Kjörling wrote:

> Hopefully other shells are more sane.

The MacBook here runs GNU bash, version 3.2.57(1)-release 
(x86_64-apple-darwin16) and is equally busted, as is plain "sh" on both 
the Mac and FreeBSD (I can't be bothered checking the Penguin); I use ZSH 
on FreeBSD and it does The Right Thing (tm), as does ZSH on the Mac.

-- Dave

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07  6:54 ` Michael Kjörling
@ 2018-08-07  8:02   ` Michael Kjörling
  2018-08-07  8:23     ` Dave Horsfall
                       ` (3 more replies)
  0 siblings, 4 replies; 32+ messages in thread
From: Michael Kjörling @ 2018-08-07  8:02 UTC (permalink / raw)
  To: tuhs

On 7 Aug 2018 06:54 +0000, from michael@kjorling.se (Michael Kjörling):
> the shell will do The Right Thing (tm)

I suspect I must stand corrected on this. Turns out that at least GNU
bash 4.4.12(1) seems to not like a `;` at the beginning of the command
line.

    $ /bin/bash --version | head -n1
    GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)
    $ /bin/bash
    $ ; true
    bash: syntax error near unexpected token `;'
    $ echo $?
    2
    $

Hopefully other shells are more sane.

-- 
Michael Kjörling • https://michael.kjorling.se • michael@kjorling.se
  “The most dangerous thought that you can have as a creative person
              is to think you know what you’re doing.” (Bret Victor)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07  7:31 ` Kurt H Maier
  2018-08-07  7:50   ` arnold
@ 2018-08-07  7:57   ` Bakul Shah
  2018-08-07 15:15   ` Brian Zick
  2 siblings, 0 replies; 32+ messages in thread
From: Bakul Shah @ 2018-08-07  7:57 UTC (permalink / raw)
  To: Kurt H Maier; +Cc: tuhs

On Tue, 07 Aug 2018 00:31:36 -0700 Kurt H Maier <khm@sciops.net> wrote:
> On Mon, Aug 06, 2018 at 09:53:33PM +0100, Brian Zick wrote:
> >
> > rc uses ;
>        
> Does it?  10th edition Unix and Plan 9 rc both have ('% ' ' ') as the   
> default value of $prompt.  At least that's how it's described in the
> manual.  None of the v8/9/10 tarballs in the archive contain rc code,
> but some contain manual source, and those describe % prompts.
>
> I've seen other references to ; (presumably  ('; ' ' ')) as the rc 
> prompt but I've never seen it in the wild.  Does anyone here know what 
> the story is?

The es shell (by Haar and Rakitzis) used ; - the reason (as
per the man page)is that a user can cut-n-paste a previous
line to rexecute it (for the same reason people use term% and
cpu% functions to execute their args).  Es syntax was derived
from rc, which may be why the confusion.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07  7:31 ` Kurt H Maier
@ 2018-08-07  7:50   ` arnold
  2018-08-07  7:57   ` Bakul Shah
  2018-08-07 15:15   ` Brian Zick
  2 siblings, 0 replies; 32+ messages in thread
From: arnold @ 2018-08-07  7:50 UTC (permalink / raw)
  To: khm, brian; +Cc: tuhs

Kurt H Maier <khm@sciops.net> wrote:

> On Mon, Aug 06, 2018 at 09:53:33PM +0100, Brian Zick wrote:
> >
> > rc uses ;
>        
> Does it?  10th edition Unix and Plan 9 rc both have ('% ' ' ') as the   
> default value of $prompt.  At least that's how it's described in the
> manual.  None of the v8/9/10 tarballs in the archive contain rc code,
> but some contain manual source, and those describe % prompts.
>
> I've seen other references to ; (presumably  ('; ' ' ')) as the rc 
> prompt but I've never seen it in the wild.  Does anyone here know what 
> the story is?
>        
> khm

I believe that Tom Duff's rc does indeed use ('% ' ' '). But I think that
Byron Rakitsis's version changed the default to ('; ' ' ') exactly for
the reason that it's copyable/pastable.

HTH,

Arnold

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-06 20:53 Brian Zick
  2018-08-06 21:16 ` ron
  2018-08-07  6:54 ` Michael Kjörling
@ 2018-08-07  7:31 ` Kurt H Maier
  2018-08-07  7:50   ` arnold
                     ` (2 more replies)
  2 siblings, 3 replies; 32+ messages in thread
From: Kurt H Maier @ 2018-08-07  7:31 UTC (permalink / raw)
  To: Brian Zick; +Cc: tuhs

On Mon, Aug 06, 2018 at 09:53:33PM +0100, Brian Zick wrote:
>
> rc uses ;
       
Does it?  10th edition Unix and Plan 9 rc both have ('% ' ' ') as the   
default value of $prompt.  At least that's how it's described in the
manual.  None of the v8/9/10 tarballs in the archive contain rc code,
but some contain manual source, and those describe % prompts.

I've seen other references to ; (presumably  ('; ' ' ')) as the rc 
prompt but I've never seen it in the wild.  Does anyone here know what 
the story is?
       
khm

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-06 20:53 Brian Zick
  2018-08-06 21:16 ` ron
@ 2018-08-07  6:54 ` Michael Kjörling
  2018-08-07  8:02   ` Michael Kjörling
  2018-08-07  7:31 ` Kurt H Maier
  2 siblings, 1 reply; 32+ messages in thread
From: Michael Kjörling @ 2018-08-07  6:54 UTC (permalink / raw)
  To: tuhs

On 6 Aug 2018 21:53 +0100, from brian@zick.io (Brian Zick):
> rc uses ;

Not sure what came first, and not up to digging out the history books,
but these days, a plain `;` for a prompt has a distinct advantage in
that you can copy the whole line and paste it into another shell, and
the shell will do The Right Thing (tm) as long as (as is, I believe,
done by all of the major shells at least) it uses `;` for command
separation.

-- 
Michael Kjörling • https://michael.kjorling.se • michael@kjorling.se
  “The most dangerous thought that you can have as a creative person
              is to think you know what you’re doing.” (Bret Victor)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-07  1:10     ` George Michaelson
@ 2018-08-07  1:12       ` ron
  0 siblings, 0 replies; 32+ messages in thread
From: ron @ 2018-08-07  1:12 UTC (permalink / raw)
  To: 'George Michaelson', 'Henry Bent'
  Cc: 'TUHS main list'

> I was told, but cannot recall by whom, that the csh decision to use % when the bourne shell had $ was to make it clear which syntax was expected by the user. tcsh inherited from csh. Bash/Zsh/Ash/Ksh inherited from sh.

I don't buy it.   CSH predates the Bourne shell by a year.   I suspect it used % because the V6 shell it replaced used %.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-06 21:33   ` Henry Bent
  2018-08-07  1:10     ` George Michaelson
@ 2018-08-07  1:10     ` ron
  1 sibling, 0 replies; 32+ messages in thread
From: ron @ 2018-08-07  1:10 UTC (permalink / raw)
  To: 'Henry Bent', 'TUHS main list'

[-- Attachment #1: Type: text/plain, Size: 1385 bytes --]

I suspect it was Steve’s personal preference on the Bourne shell.   There’s next to no comments in the thing and the document on the shell just mentions the defaults and that you can change it.

Just for completeness, the PWBSH appears to allow the prompt to be changed with a command line argument.

 

We used to have a shell called “uu” at Hopkins which was sort of a prehistoric “sudo” that ran certain commands (icheck/dcheck/etc…) as root while setting back to the regular uid for others.  It used “@ “ for a prompt.    

 

 

 

From: TUHS <tuhs-bounces@minnie.tuhs.org> On Behalf Of Henry Bent
Sent: Monday, August 6, 2018 5:33 PM
To: TUHS main list <tuhs@minnie.tuhs.org>
Subject: Re: [TUHS] Origins of shell prompt suffixes % $ > #

 

On 6 August 2018 at 17:16, <ron@ronnatalie.com <mailto:ron@ronnatalie.com> > wrote:

The early shells (Thompson, Mashey)  used "% " for regular user (and # for root).   The Thompson shell didn't have a setable prompt.
The Bourne shell (V7) had setable PS1 (start of command) and PS2 (continuation prompts) and set the to "$ " and "> " respectively.    Again # was used for root 

 

Okay, but why did Bourne switch from "%" to "$"?  Was it to inform the user that they were using the new shell as opposed to the old one, or was there some other reasoning behind the switch?

 

-Henry


[-- Attachment #2: Type: text/html, Size: 4165 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-06 21:33   ` Henry Bent
@ 2018-08-07  1:10     ` George Michaelson
  2018-08-07  1:12       ` ron
  2018-08-07  1:10     ` ron
  1 sibling, 1 reply; 32+ messages in thread
From: George Michaelson @ 2018-08-07  1:10 UTC (permalink / raw)
  To: Henry Bent; +Cc: TUHS main list

Off topic to one side:

I was told, but cannot recall by whom, that the csh decision to use %
when the bourne shell had $ was to make it clear which syntax was
expected by the user. tcsh inherited from csh. Bash/Zsh/Ash/Ksh
inherited from sh.

Obviously that is outside the strict terms of the question and lies in
hands, not this lists main focus.

-G

On Tue, Aug 7, 2018 at 7:33 AM, Henry Bent <henry.r.bent@gmail.com> wrote:
> On 6 August 2018 at 17:16, <ron@ronnatalie.com> wrote:
>>
>> The early shells (Thompson, Mashey)  used "% " for regular user (and # for
>> root).   The Thompson shell didn't have a setable prompt.
>> The Bourne shell (V7) had setable PS1 (start of command) and PS2
>> (continuation prompts) and set the to "$ " and "> " respectively.    Again #
>> was used for root
>
>
> Okay, but why did Bourne switch from "%" to "$"?  Was it to inform the user
> that they were using the new shell as opposed to the old one, or was there
> some other reasoning behind the switch?
>
> -Henry

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-06 21:16 ` ron
@ 2018-08-06 21:33   ` Henry Bent
  2018-08-07  1:10     ` George Michaelson
  2018-08-07  1:10     ` ron
  0 siblings, 2 replies; 32+ messages in thread
From: Henry Bent @ 2018-08-06 21:33 UTC (permalink / raw)
  To: TUHS main list

[-- Attachment #1: Type: text/plain, Size: 560 bytes --]

On 6 August 2018 at 17:16, <ron@ronnatalie.com> wrote:

> The early shells (Thompson, Mashey)  used "% " for regular user (and # for
> root).   The Thompson shell didn't have a setable prompt.
> The Bourne shell (V7) had setable PS1 (start of command) and PS2
> (continuation prompts) and set the to "$ " and "> " respectively.    Again
> # was used for root


Okay, but why did Bourne switch from "%" to "$"?  Was it to inform the user
that they were using the new shell as opposed to the old one, or was there
some other reasoning behind the switch?

-Henry

[-- Attachment #2: Type: text/html, Size: 958 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [TUHS] Origins of shell prompt suffixes % $ > #
  2018-08-06 20:53 Brian Zick
@ 2018-08-06 21:16 ` ron
  2018-08-06 21:33   ` Henry Bent
  2018-08-07  6:54 ` Michael Kjörling
  2018-08-07  7:31 ` Kurt H Maier
  2 siblings, 1 reply; 32+ messages in thread
From: ron @ 2018-08-06 21:16 UTC (permalink / raw)
  To: 'Brian Zick', tuhs

The early shells (Thompson, Mashey)  used "% " for regular user (and # for root).   The Thompson shell didn't have a setable prompt.
The Bourne shell (V7) had setable PS1 (start of command) and PS2 (continuation prompts) and set the to "$ " and "> " respectively.    Again # was used for root.


-----Original Message-----
From: TUHS <tuhs-bounces@minnie.tuhs.org> On Behalf Of Brian Zick
Sent: Monday, August 6, 2018 4:54 PM
To: tuhs@minnie.tuhs.org
Subject: [TUHS] Origins of shell prompt suffixes % $ > #

Hi,

I usually just lurk on this list, but I've been curious lately about the origin of the symbols at the end of various interactive prompts.

ksh (etc), bash, sh use $ for non-root, and # for root

csh, tcsh and zsh use % for non-root and # for root

fish and things like mysql, ftp, and interactive shells for a lot of scripting languages use >

rc uses ;

Where do these different conventions originate?

B


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [TUHS] Origins of shell prompt suffixes % $ > #
@ 2018-08-06 20:53 Brian Zick
  2018-08-06 21:16 ` ron
                   ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Brian Zick @ 2018-08-06 20:53 UTC (permalink / raw)
  To: tuhs

Hi,

I usually just lurk on this list, but I've been curious lately about the origin of the symbols at the end of various interactive prompts.

ksh (etc), bash, sh use $ for non-root, and # for root

csh, tcsh and zsh use % for non-root and # for root

fish and things like mysql, ftp, and interactive shells for a lot of scripting languages use >

rc uses ;

Where do these different conventions originate?

B

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2018-08-09  3:06 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-08 15:20 [TUHS] Origins of shell prompt suffixes % $ > # Noel Chiappa
2018-08-08 16:01 ` Gilles Gravier
2018-08-08 20:29   ` ron
2018-08-08 20:30   ` Clem Cole
2018-08-08 20:51     ` Warner Losh
2018-08-09  2:50   ` William Corcoran
  -- strict thread matches above, loose matches on Subject: below --
2018-08-07 12:34 Doug McIlroy
2018-08-06 20:53 Brian Zick
2018-08-06 21:16 ` ron
2018-08-06 21:33   ` Henry Bent
2018-08-07  1:10     ` George Michaelson
2018-08-07  1:12       ` ron
2018-08-07  1:10     ` ron
2018-08-07  6:54 ` Michael Kjörling
2018-08-07  8:02   ` Michael Kjörling
2018-08-07  8:23     ` Dave Horsfall
2018-08-07  8:37       ` KatolaZ
2018-08-07 10:45     ` Tony Finch
2018-08-07 17:35       ` Lyndon Nerenberg
2018-08-08 14:38       ` Nemo
2018-08-08 14:51         ` Clem Cole
2018-08-07 11:24     ` Pete Turnbull
2018-08-08 19:55     ` Derek Fawcus
2018-08-07  7:31 ` Kurt H Maier
2018-08-07  7:50   ` arnold
2018-08-07  7:57   ` Bakul Shah
2018-08-07 15:15   ` Brian Zick
2018-08-07 15:52     ` John P. Linderman
2018-08-07 18:09     ` Cág
2018-08-07 18:51       ` arnold
2018-08-07 19:00         ` Cág
2018-08-07 19:06           ` Brian Zick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).