From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12008 invoked by alias); 1 Mar 2015 19:12: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: 19940 Received: (qmail 25629 invoked from network); 1 Mar 2015 19:12:13 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_FSL_HELO_BARE_IP_2 autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1425236408; bh=DWc88rNTpy89L0WAhufbJykg1dPe2n6WUu0MFDeiU1g=; h=From:To:In-Reply-To:References:Subject:Date; b=fCaW5wjBAKBOKbtmEyK3/IMwSkaI2+8solBh/rJXfiyO2QGkyCaWZeIyj+wPUssvX Rxshl9sW+kvuQI6GLMdDScvxHs24cHEQmocwiQRNzOejeLEfcdFGdutIFgcPdHoLKD jVPI1lsEf2+XbFA09sKuSRerV84yPoKcEAQ/MHSY= From: ZyX To: Bart Schaefer , zsh Users In-Reply-To: <150301104829.ZM16206@torch.brasslantern.com> References: <54F33934.2070607@eastlink.ca> <13666281425228233@web7o.yandex.ru> <54F345D3.9010204@eastlink.ca> <150301104829.ZM16206@torch.brasslantern.com> Subject: Re: grammar triviality with '&&' MIME-Version: 1.0 Message-Id: <48511425236406@web16g.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sun, 01 Mar 2015 22:00:06 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r 01.03.2015, 21:50, "Bart Schaefer" : > On Mar 1, š9:01am, Ray Andrews wrote: > } > } I see, so it's not a 'hard' syntactic issue > > Actually it IS a "hard" syntactic issue, in the sense that the grammar > for all *nix shells [1] both immemorial and standard, formally defines > newline as equivalent to semicolon. > > You can demonstrate that this is the case [2] by: > > torch% false && ; echo AND || ; echo OR > OR > torch% false ; && echo AND ; || echo OR > zsh: parse error near `&&' > > [1] I don't consider here "shells" written to use the syntax of other > interpreted languages, such as shells that execute perl or php or > python statements. > > [2] Actually bash throws a syntax error on that "&& ;", but both zsh > and ksh accept it. šChet? (Almost) pure POSIX shells like dash, posh and busybox ash also throw syntax error here. This is a direct consequence of how grammar is defined in http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10_02. Ksh and zsh are far from being POSIX shells.