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.0 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,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 6a59cb2c for ; Sat, 10 Nov 2018 02:08:17 +0000 (UTC) Received: (qmail 28974 invoked by alias); 10 Nov 2018 02:08:05 -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: 23752 Received: (qmail 1265 invoked by uid 1010); 10 Nov 2018 02:08:05 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf1-f45.google.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(209.85.167.45):SA:0(-2.0/5.0):. Processed in 3.626021 secs); 10 Nov 2018 02:08:05 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=QseUYFkrUdUmyk3HONuSRs+5ksMcuKAT7mK975P4gmg=; b=vTZjpb1ZIPqWGBnR8fqIwRZJO+bIeXqxfwVjtRP2lYYVSn5hyJTNUsZnjJoSS5AoOl +x5T2OIOWeaEVYqaW2xzyddnEUZq4tDa4i3lm+WKuIzoGA81Bbt7OJP7dgWzP1j/yJ6X otP3TdFnhB9K9eIxntesnIl9O3CRsAwRJCP40c5gln4sQWtUVk2cMJkKgbDTq3LwuXSD 9O0AQSyowznIdzE8VpMX5HjcwG8Z099zdg3+8us5Zk2Iw+Uu9IpaTgQR2YLTUXIuaBLM SIyByZcnmM7mClpUycwKbtzM2NK9Z+eisIDBm33SVw8xWYU84UHAjEnz6fViMzWnSTOn cloA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=QseUYFkrUdUmyk3HONuSRs+5ksMcuKAT7mK975P4gmg=; b=VEui1MD2nXcTBAL+opTaFD4dr31GPfFHte0vZiMLdYMQWA1zisSRJ4NSvebmQI8pJp 1ebx6j3QegJ8zue5AzVnKmrzoQBJBmINJfMmNESicVs1efD4Un6rGNLuVK0q+hDkE5Dv KyGRixKQKSIoGTq9/lhTwOJnHHv8qGk36nlTDcAahTsIQSUOg4Mn620ADjbQhPP3H2tV E1MJge7PZnbGxEXQqiPH6GIb9SAOp3fgMAtSIgZcZUV+YIoyX84mbi9e+EA+8IhUZQyN iq7WdZiaNkrNZoUDxBFZTK1A0QQFKcOveBgIuRedvmDrkL9k7vivj4Vo3KXDgWLZy7+P /Q1A== X-Gm-Message-State: AGRZ1gKEFR+GxYIwZ+6D/LlNewazmtqdXOUie3C9P9rqgflxf8Ij1IC1 JcfuXNCJ8zBG0jUoiOdyJ5xCt0Yi/cjd5kzUSMI2/LNgPSQ= X-Google-Smtp-Source: AJdET5dsrfArB7BxRTXqX346n7U0y2Wn1KGYlKJgk0vCnMf96qr3rBKhdrM4pGx4Ulw4PdnPBaz6jV5bbmHU4V0BMis= X-Received: by 2002:ac2:50c4:: with SMTP id h4mr2308601lfm.81.1541815676619; Fri, 09 Nov 2018 18:07:56 -0800 (PST) MIME-Version: 1.0 References: <1541756153.3720.1.camel@samsung.com> <1541812878.2985396.1571973512.684C1909@webmail.messagingengine.com> In-Reply-To: <1541812878.2985396.1571973512.684C1909@webmail.messagingengine.com> From: Bart Schaefer Date: Fri, 9 Nov 2018 18:07:43 -0800 Message-ID: Subject: Re: Use glob patterns while reading a file To: Daniel Shahaf Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Nov 9, 2018 at 5:22 PM Daniel Shahaf wrote= : > > > > $(< ./(a|b)(N)) > > > > 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 b= e > composable and shouldn't have special cases. Although I can't argue with this from a philosophical standpoint, I find it astonishing to pretend that zsh ignores that philosophy only in this particular case. > The forms =C2=ABfoo=C2=BB and > =C2=ABprint -r -- "$( a trailing newline). I don't follow that at all. =C2=ABfoo=C2=BB is a shell word. =C2=ABprint = -r -- "$( Similarly, =C2=AB equivalent, but =C2=AB$(<*)=C2=BB and =C2=AB$(<* $READNULLCMD)=C2=BB are = not. The distinction here is that $(...) is a substitution, not a subshell. It's more like a quoting mechanism (i.e. `foo`). $( was this behaviour intentionally implemented this way? Yes.