What's the proper way to do a for loop over a file mask?
E.g. if the mask doesn't expand to any file, then the loop should not run; else, it should run over all the files that it expands to.
The problem with naive approach is that if the *
doesn't expand to anything, then the whole loop will run once as if the *
part is an actual part of a filename (of a file that doesn't actually exist).