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 [email protected] http://tiswww.cwru.edu/~chet/
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net