From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7147 invoked by alias); 15 Jul 2018 12:26:10 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 43173 Received: (qmail 28109 invoked by uid 1010); 15 Jul 2018 12:26:10 -0000 X-Qmail-Scanner-Diagnostics: from wout5-smtp.messagingengine.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(64.147.123.21):SA:0(-1.8/5.0):. Processed in 3.49448 secs); 15 Jul 2018 12:26:10 -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.8 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_NEUTRAL,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: ravi@hale.ee X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=0M3/alLrbljivm+kemBpKjSzF3OXn U5a/gS9WExDV+o=; b=ZomW8i+xBVaBFuDq2anMV5y8hRsz3kDgrV3gGIC0WEqJr AldbAXTxOwNSI0jW+worU9O1VHp6xinsxN6BCd5iuUWpUPXTatR05KemojJjuCVW rfzHGvf/r/YGDHVWRA/W3EVi1yP1duZVe+bDbbht31TCDmZfbyeEs5+oqrWE+g86 5QIO4n3VFapbdqD25GO2oUfi4S5LS7Oh9Cvb3/Qa6QaWswiswQzU+0Xoz79oky+m 4Ha5tpkS59Z6Wgyzm3ODE10RyKUtmDuVc8CZ9u2JNRjZkuyol6105yN2wJd4p/EV OsqIbaRmNllI6NwLBAxnvB2OcZ8kL630zLKhNTIXg== X-ME-Proxy: X-ME-Sender: To: zsh-workers@zsh.org From: "Ravi (Tom) Hale" Subject: POSIX: reserved words should not expand into aliases Message-ID: Date: Sun, 15 Jul 2018 19:16:00 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-AU Content-Transfer-Encoding: 7bit The [POSIX Shell Command Language section 2.3.1](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_03_01) says: > However, reserved words in correct grammatical context shall not be candidates for alias substitution. It seems that both `{ba,z}sh` have a bug here. How do I access a reserved word if an alias is hiding it? Here `if` works normally: % if : ; then echo true; fi true After aliasing `if`: % alias if=date % if : ; then echo true; fi zsh: parse error near `then' Prefixing with `builtin` or `\` doesn't help: % builtin if : ; then echo true; fi zsh: parse error near `then' % \if : ; then echo true; fi zsh: parse error near `then' How do I access a reserved word in the pathological case that it hidden by an alias? Prior art: https://unix.stackexchange.com/q/456408/143394