我需要创建一个脚本,其内容如下:
if directory contains atleast one file (1 or more) that starts with 'naz'
#do something
else (contains 0 files that start with 'naz')
#do something else
我的问题是,当我尝试时
if [ -f naz* ]
我最终遇到了
bash: [: 参数太多
因为符合条件的文件超过了1个。我正在寻找适用于找到多个文件的解决方案。