Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Use glob patterns while reading a file



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



Messages sorted by: Reverse Date, Date, Thread, Author