Say I have a folder with three files:
foo1
foo2
bar
1. If I run
list_of_files=$(print foo*)
echo $list_of_files
I get: foo1 foo2
2. If I run
list_of_files=$(print bar*)
echo $list_of_files
I get: bar
3. However, if I run
list_of_files=$(print other*)
echo $list_of_files
I get: zsh: no matches found: other*
(the variable $list_of_files
is empty though)
Is there a way to ask zsh to not complain if it can't match a glob expansion?
My goal is to use the mechanism above to silently collect a list of files that match a given glob pattern.
.
in(.N)
? Other answers have(N)
by itself, what is the difference? – Michael Francis Apr 17 '19 at 16:31.
restricts the glob to match only files. – arnt Apr 17 '19 at 16:46