I'm making a script that's supposed to do different things depending of how many files there is in a folder that starts with ref
I've tried to do a count with this for-loop:
for file in $dir/ref*
It seems to work fine, as long as there is at least one file starting with ref
in the folder. If there is none the loop runs once with the variable file as "$dir/ref*
". Anybody got some suggestion on how I could avoid that? Alternative solutions are also welcome
Thanks a lot in advance!