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=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,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 a9ba75f4 for ; Thu, 8 Nov 2018 22:54:00 +0000 (UTC) Received: (qmail 11500 invoked by alias); 8 Nov 2018 22:53:43 -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: 23747 Received: (qmail 29573 invoked by uid 1010); 8 Nov 2018 22:53:43 -0000 X-Qmail-Scanner-Diagnostics: from mail-wm1-f48.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.128.48):SA:0(-1.8/5.0):. Processed in 2.349342 secs); 08 Nov 2018 22:53:43 -0000 X-Envelope-From: dritter03@googlemail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=yLXyTMyqyOuD/k1fZsZV0mas2qfXJDEFUOELng80jQY=; b=NsZVYWuVVkWkgCNnIWr+p5xlI8SeBZp3gNthNEA47fdV8zoSCPhi4GM7tO046Z3oT2 xegCTKHm6b2Mhu1+f86gyAeQxkEh8AzLdCwHX7RwXrYDtrHjBXJfOsYg8g8pvDC1kKLI /VCWwcX+2wQzh6jPQ62gJE/xizgqRwW4UCW1TrNorSGoDMJegHcaHUNazOdbvtmJDlM4 T0pkNooiTFrF6/C8R3o91A2o5IL8VtXUMzKAnNaljQisNaGuSsmOCi9yTiuUgvlooQsS xuJt6s+AQ1tl7yRQ0NSL023zOxmMm2/1dCeCPkLgHVtkYJdSE4UjuWxs+04haRoQB307 tT3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=yLXyTMyqyOuD/k1fZsZV0mas2qfXJDEFUOELng80jQY=; b=kpORKEEc0tFFj8AIqlcn80vrwD0C93DilMpgP9Rtorut7S2oJ+cpAJkAfPOmr0oe3a Zl3Mcn2nXfJCR6/ZyqWUqEZW37skvUsolYho1lpLDnn+cmSjAGzAgHuNU9Kdu5mUKzHe lEzA/fYsUKjJlEJOVsIFCQWd/1N/W78ND2zMdBB5MC0s2G9eurloGrYR3msahQV29sP+ 3xFNUL3QsUqLNBh5ZOiVICtezJAClmKMbttZf52e91jbYkdCEpN+1NpKtXSbv70ec/LM Q2xGnA4wJEr9OTR5Z1cE1+6LtikLesujecXG2eqwN4qmp4ELEj/Yew9hg/vubDjNhPOE d4kg== X-Gm-Message-State: AGRZ1gKs3AP1iaBDLUZrt2ObdoW6JsRFZnIUtfF6zgg5TcnIHTvs//W/ O1n0Jkd8Gmqk9xAwTFZ+m8NVHp8gLvIAHgCJ+hgGNlI7 X-Google-Smtp-Source: AJdET5d9KvFdxMQzz4oXG1mlF0N/ou9RNUGAFA2N3qaMH9szUSk513WUdjj6TeFEfZaco8wExM9xZJ9ltwAwztK7DdA= X-Received: by 2002:a1c:c015:: with SMTP id q21-v6mr2478352wmf.99.1541717615677; Thu, 08 Nov 2018 14:53:35 -0800 (PST) MIME-Version: 1.0 From: Dominik Ritter Date: Thu, 8 Nov 2018 23:53:24 +0100 Message-ID: Subject: Use glob patterns while reading a file To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary="000000000000d39518057a2f1abb" --000000000000d39518057a2f1abb Content-Type: text/plain; charset="UTF-8" Hi all! 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)) Without the subshell, the glob is expanded first, thus it works: < ./(a|b)(N) Is it possible to get this to work in conjunction with a subshell? The usual workarounds are to expand the glob first, and iterate over the resulting files, test for existance and finally read the contents. This seems quite cumbersome to me. Thanks for your help, Dominik --000000000000d39518057a2f1abb--