Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: while loop grammar question





On Sun, Dec 8, 2024 at 1:45 AM Lawrence Velázquez <larryv@xxxxxxx> wrote:

I don't know whether this behavior is intentional or not.
A comparable "if" command errors out:

        % cat /tmp/users-30115-4.zsh
        if ((1))
        {
                print true
        }
        % zsh -f /tmp/users-30115-4.zsh
        /tmp/users-30115-4.zsh:5: parse error near `\n'

but if you run it interactively, you'll find that you're still in the `if>` condition after the close curly, So it's similar to the while loop; it's just not letting you get away without a then.

--
Mark J. Reed <markjreed@xxxxxxxxx>


Messages sorted by: Reverse Date, Date, Thread, Author