When I loop through all the files starting by foo
I do
for f in foo* ; do echo "result = $f" ; done
The problem is when no file start by foo
I get:
result = foo*
Meaning that the loop is executed once, even if no file start by foo
.
How is this possible? How can I loop through all files (and not loop at all if there is no file)?