zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Users' List <zsh-users@zsh.org>
Subject: Re: Use glob patterns while reading a file
Date: Fri, 9 Nov 2018 16:20:34 +0000	[thread overview]
Message-ID: <1541780434.3720.18.camel@samsung.com> (raw)
In-Reply-To: <CAJjRh0RvytSn53CxbfSUfmWzoJgfyiaBy47Wr4jHCAmJiSP2ew@mail.gmail.com>

On Fri, 2018-11-09 at 15:37 +0100, Dominik Ritter wrote:
> I was hoping for a solution without externals. The cat version seems
> to be slower than the other one, and I the null glob seems not to
> work, if neither of the files was found..

There are various ways of outputting files from within the shell.  You
can do something like

zmodload zsh/mapfile
... $(files=(./(a|b)(N)); print -nr "$mapfile[$files[1]]")

pws


  reply	other threads:[~2018-11-09 16:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20181108225555epcas2p274de218aef35e46f189ebbfbd9d1892f@epcas2p2.samsung.com>
2018-11-08 22:53 ` Dominik Ritter
2018-11-09  9:35   ` Peter Stephenson
2018-11-09 14:37     ` Dominik Ritter
2018-11-09 16:20       ` Peter Stephenson [this message]
2018-11-10  1:21     ` Daniel Shahaf
2018-11-10  2:07       ` Bart Schaefer
2018-11-10  2:12         ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1541780434.3720.18.camel@samsung.com \
    --to=p.stephenson@samsung.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).