bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: select syntax violates the POLA


From: Dale R. Worley
Subject: Re: select syntax violates the POLA
Date: Sun, 04 Apr 2021 20:27:15 -0400

Robert Elz <kre@munnari.OZ.AU> writes:
>     From:        worley@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

[Prev in Thread] Current Thread [Next in Thread]