Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Unterminated for loop
- X-seq: zsh-users 29083
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Unterminated for loop
- Date: Wed, 7 Jun 2023 01:12:26 +0200
- Archived-at: <https://zsh.org/users/29083>
- In-reply-to: <CAN=4vMoM64ZT3uJ2iSndERUKdcyt5cyU8tEshF76HjYhUznBsg@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAN=4vMoM64ZT3uJ2iSndERUKdcyt5cyU8tEshF76HjYhUznBsg@mail.gmail.com>
On 6/6/23, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx> wrote:
> If I type `for x;` (without the quotes) and press ENTER in an interactive
> zsh, I end up in PS2. However, the exact same sequence of characters is
> treated as a complete command in a script or function. Why is that?
It is accepted because SHORT_LOOPS is unfortunately set by default,
which tends to hide a lot of syntax errors in various contexts. It's
no surprise that it causes weird differences with script EOF vs
accepting a single line interactively.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author