Robert Elz <k...@munnari.oz.au> writes:
>     From:        wor...@alum.mit.edu (Dale R. Worley)
>
>   | I was going to ask why "else {" works,
>
> The right question would be why '} else' works.

Yeah, typo on my part.  The manual page says

       if list; then list; [ elif list; then list; ] ... [ else list; ] fi

so clearly there should be a ; or newline before the list in the
else-clause.  But the grammar doesn't seem to enforce that:

        if_clause  : If compound_list Then compound_list else_part Fi

I'm sure that the real answer involves decrypting the logic inside Bash
that turns on recognition of reserved words, and that must be more
complicated than the rule in the manual page.

Dale

Reply via email to