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

Re: Can zsh `else` reserved keyword command be aliased and the lexem itself be repurposed as `fi` keyword command?



On Thu, Dec 28, 2017 at 7:19 AM, mathieu stumpf guntz
<psychoslave@xxxxxxxxxxxxxxxxx> wrote:
>
>      ▶ export LANC=C enable -r else; if true; then else fi; disable -r else

You're missing a semicolon after the "C".  That's the reason you get

>      => export: not valid in this context: -r


> Is there a way to force execution at some point on a single line, as if
> there was performed on two lines?

If I understand your question, the answer is "no": you can't execute
the front part of an "if" until the "fi" has been read.  See my
previous email "fully parsed before executed."

(Well, you could switch to csh, which does execute every line as it
goes along, even in complex structures.  But no, not in zsh.)



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