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

Re: Unterminated for loop



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