From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19894 invoked by alias); 4 Mar 2015 14:48:16 -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: X-Seq: 19967 Received: (qmail 1788 invoked from network); 4 Mar 2015 14:48:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_PCNT autolearn=no version=3.3.2 Date: Wed, 4 Mar 2015 15:47:56 +0100 From: Vincent Lefevre To: zsh-users@zsh.org Subject: Re: grammar triviality with '&&' Message-ID: <20150304144756.GA27231@ypig.lip.ens-lyon.fr> Mail-Followup-To: zsh-users@zsh.org References: <54F33934.2070607@eastlink.ca> <13666281425228233@web7o.yandex.ru> <54F345D3.9010204@eastlink.ca> <20150302022754.GA7449@xvii.vinc17.org> <20150302104619.GC6869@xvii.vinc17.org> <20150302110610.2e2c7e86@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.23-6424-vl-r76280 (2015-02-19) On 2015-03-02 11:19:25 -0800, Bart Schaefer wrote: > % alias and='(){ return $? } && ' > > (Trailing space thrown in to expand aliases again in the next word.) I've found a bug: % alias '&&=(){ return $? } && ' % && echo OK zsh: parse error near `&&' Since && will be replaced by the alias, there's no reason to get a parsing error. The zshexpn(1) man page says: Alias Expansion Aliases are expanded immediately before the command line is parsed as explained under Aliasing in zshmisc(1). Note the "before the command line is parsed". -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)