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

Use glob patterns while reading a file



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


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