[TUHS] Origins of shell prompt suffixes % $ > #

Pete Turnbull pete at dunnington.plus.com
Tue Aug 7 21:24:20 AEST 2018


On 07/08/2018 09:02, Michael Kjörling wrote:
> On 7 Aug 2018 06:54 +0000, from michael at 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



More information about the TUHS mailing list