开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜