[Toybox] is orthodoxy a strong value of toybox?

Chet Ramey chet.ramey at case.edu
Tue Sep 6 07:06:47 PDT 2022


On 9/5/22 12:42 PM, Rob Landley wrote:
I still don't
> understand why ";" on its own without a statement in front of it is an error,
> leading to:
> 
>    $ if true; then; echo hello; fi
>    bash: syntax error near unexpected token `;'
>    $ if true; then
>    > echo hello; fi
>    hello
> 
> I mean, LOGICALLY the ; and the line break should be the same, right? But no.
> You can have a line break in places you can't have a ; and... ok then?

That's how the grammar reads. A `compound list' can start with 0 or more
newlines, but not a separator op like `;' or `&'.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet at case.edu    http://tiswww.cwru.edu/~chet/



More information about the Toybox mailing list