From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25932 invoked by alias); 29 Dec 2017 10:51:28 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23020 Received: (qmail 20340 invoked by uid 1010); 29 Dec 2017 10:51:28 -0000 X-Qmail-Scanner-Diagnostics: from mail.epopia.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(137.74.101.162):SA:0(-1.9/5.0):. Processed in 8.187674 secs); 29 Dec 2017 10:51:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: psychoslave@culture-libre.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Subject: Re: Can zsh `else` reserved keyword command be aliased and the lexem itself be repurposed as `fi` keyword command? To: Bart Schaefer , Zsh Users References: From: mathieu stumpf guntz Message-ID: <71ef7896-39f8-66fe-f8f8-c7c81b11e2ce@culture-libre.org> Date: Fri, 29 Dec 2017 11:51:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------21313AB0F270719A9C57177E" Content-Language: fr-FR --------------21313AB0F270719A9C57177E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Le 29/12/2017 à 09:47, Bart Schaefer a écrit : > You're missing a semicolon after the "C". That's the reason you get Thank you. For some reason however, the seconde run of `export LANC=C; enable -r else; if true; then echo 'yep'; else echo 'nop'; fi; disable -r else` will return an error message with the system local anyway: % enable -r else; % export LANC=C; enable -r else; if true; then echo 'yep'; else echo 'nop'; fi; disable -r else yep % export LANC=C; enable -r else; if true; then echo 'yep'; else echo 'nop'; fi; disable -r else yep zsh: else: commande inconnue. > 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." I'm rather estonished by this lake of possibility to make the equivalent of an "\n" in the middle of a line, but OK. So the idea would be to have something like % whence -w else else: reserved % enable -r else; "\n" whence -w else; if true; then echo 'yep'; else echo 'nop'; fi; disable -r else else: reserved yep % whence -w else else: none % enable -r else; "\n" whence -w else; if true; then echo 'yep'; else echo 'nop'; fi; disable -r else else: reserved yep But "\n" doesn't work here as a substitution of an effective linefeed. > (Well, you could switch to csh, which does execute every line as it > goes along, even in complex structures. But no, not in zsh.) Nice to know, thank you. --------------21313AB0F270719A9C57177E--