Selecting multiple file extensions, when some don't exist
I want to select all files with extension f, F and F90. Currently I am trying something like
echo *.f *.F *.f90
However, if there are no .f files in the directory (and there is always one of the three) I get left with the *.f, i.e it echos
*.f file1.F file2.f90
开发者_如何学运维Which, if I want to delete them will always complain as *.f doesn't exist.
shopt -s nullglob
will fix this in Bash, but is not portable.
精彩评论