4 deleted 69 characters in body
source | link

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. Any alternative suggestions to do this would be greatly appreciated.

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. Any alternative suggestions to do this would be greatly appreciated.

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.

3 Added tag wildcards.
| link
2 added 1 characters in body
source | link

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 cantcan'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. Any alternative suggestions to do this would be greatly appreciated.

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 cant 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. Any alternative suggestions to do this would be greatly appreciated.

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. Any alternative suggestions to do this would be greatly appreciated.

    Tweeted twitter.com/#!/StackUnix/status/146913293452324865
1
source | link