From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20519 invoked by alias); 2 Mar 2015 19:25:31 -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: 19962 Received: (qmail 2893 invoked from network); 2 Mar 2015 19:25:29 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Authority-Analysis: v=2.1 cv=X+5rdgje c=1 sm=1 tr=0 a=jzv7pUNyk+0Y+COVCE1LmA==:117 a=jzv7pUNyk+0Y+COVCE1LmA==:17 a=VNsaWKQvMhEA:10 a=IkcTkHD0fZMA:10 a=4bny9WDPFCv1pbr9P-wA:9 a=QEXdDO2ut3YA:10 Message-id: <54F4B926.5090105@eastlink.ca> Date: Mon, 02 Mar 2015 11:25:26 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.4.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: grammar triviality with '&&' References: <54F33934.2070607@eastlink.ca> <13666281425228233@web7o.yandex.ru> <54F345D3.9010204@eastlink.ca> <20150302022754.GA7449@xvii.vinc17.org> <54F3E489.5050603@eastlink.ca> <54F48D26.6040303@eastlink.ca> In-reply-to: Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit On 03/02/2015 10:52 AM, Kurtis Rader wrote: > Why are you using ancient Bourne-shell syntax? If you need compatibility > with the Bourn-shell you can't use the feature you're asking for. If you > use the slightly less ancient Korn-shell syntax you can break the test > across lines the way you want: So I see. Thanks, I didn't know about using [[ that way: > > #!/bin/zsh > ozymandia=yes > > if [[ -e 'shelly.txt' > && -n "$ozymandia" > && -n $(grep "I met a traveler" shelly.txt) ]] > then > echo "Look on my works, ye mighty" > fi > > Note that I fixed your command as "grep" isn't a valid test; although, I > wouldn't write it that way in practice as it isn't efficient. Doesn't matter, I just made that up. Anyway, it was a theoretical issue gentlemen, I just thought I'd ask, I don't really have any great difficulties using the line continuation. It seems this 'errexit' thing does create a hard syntactic issue so that answers my question. >