From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 1c620f7e for ; Sat, 10 Nov 2018 01:21:53 +0000 (UTC) Received: (qmail 1901 invoked by alias); 10 Nov 2018 01:21:34 -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: 23751 Received: (qmail 29757 invoked by uid 1010); 10 Nov 2018 01:21:34 -0000 X-Qmail-Scanner-Diagnostics: from out5-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(66.111.4.29):SA:0(-2.6/5.0):. Processed in 5.261088 secs); 10 Nov 2018 01:21:34 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=message-id:from:to:mime-version :content-transfer-encoding:content-type:references:subject:date :in-reply-to; s=fm1; bh=kYXTyuuLIgsEZym2vpDMpsP48AMMFTrS6t7eRqGk UVY=; b=cchLdRJgJN4Vodn+QK4KMmSJ1gBw5C34MMyLD3x+dacSZZhDLn7K7QID eSbOxjga4qEtVoOwc7B+u3EqO4/F18bN56L9VinmYXR/eLiEhhng06EXtJbEugzG qJ+oTdsuU+1n0Ybn4zeJ6ABYq1a9ILRHs7254ZvuGnLfyzYUYutdx7cenF3OSHFh 8QewwUlQzXJ3wI2LmEbC4q80ZOT/f06v4EPqS50wxx0cPVuOZhN1CTbzR7JXUMcH do9Bf1zLwNBh8BtZgPvX6mvM4BCqfuLK8Ii633x+hcc8jycm0kW8tKLwsYa37lx0 jSUizao9QWJXh9EyNBAZnuRdMRNA6g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=kYXTyuuLIgsEZym2vpDMpsP48AMMFTrS6t7eRqGkU VY=; b=n13vOtDy8g2p8eeaP2O8IHbt4YtuWpxvvPvPqbR0dxwYZ3PTPICQ4WAMF DpeyM6v5zhxdv5L4I0DcAQhONgMssGYXvJ4hqG9nH744eqt4LWxXGadF5aXHpldt c0ucm9N488Hx1m5WsQ2miZ9+sbvbtCYIIzSkFFTgIkh/DOCIYVelML2lgm8AMvC7 +A6ns+1z7W6r/15FZO7oE3wl5yIx6GyJkXEXU84DfWiSFeAsYZJWgj452KWpX8nT ArzvJj2vzcZCz0ZPyrtTiq+5cxJXB/pWosxabetUy3klxsEPsyPDG2qjHSr9WcUV TOCrSxXnUtXnexcVxHpEbdz2cMvxQ== X-ME-Sender: X-ME-Proxy: Message-Id: <1541812878.2985396.1571973512.684C1909@webmail.messagingengine.com> From: Daniel Shahaf To: zsh-users@zsh.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-c0552f07 References: <1541756153.3720.1.camel@samsung.com> Subject: Re: Use glob patterns while reading a file Date: Sat, 10 Nov 2018 01:21:18 +0000 In-Reply-To: <1541756153.3720.1.camel@samsung.com> Peter Stephenson wrote on Fri, 09 Nov 2018 09:35 +0000: > On Thu, 2018-11-08 at 23:53 +0100, Dominik Ritter wrote: > > I want to use read one of two files, regardless if it exists or not. My > > first approach is to use the alternative glob syntax, but with no luck: > > $(< ./(a|b)(N)) >=20 > That's a special syntax, expecting a single file so that it doesn't try > to do globbing. I think this violates the principle of least surprise. Grammars should be composable and shouldn't have special cases. The forms =C2=ABfoo=C2=BB and =C2=ABprint -r -- "$( The manual says: . The substitution `tt($LPAR()cat) var(foo)tt(RPAR())' may be replaced by the equivalent but faster `tt($LPAR()<)var(foo)tt(RPAR())'. . which is correct only when var(foo) does not involve globbing. I don't wan= t to open the user manual v. reference manual can of worms again, but I think th= ere is room for improvement here. > You can get it to work with >=20 > $(cat <./(a|b)(N)) Cheers, Daniel