【发布时间】:2017-10-05 08:27:44
【问题描述】:
考虑这个简单的脚本:
#!/bin/bash
DIR="$1"
for f in "$DIR"; do
if [[ "$f" == "*.txt" ]];
then
echo "Filename is $f"
fi
done
我只想返回带有 .txt 扩展名的文件。调用脚本:
./script1 /home/admin/Documents
什么都不返回。没有错误,只是空白。怎么了?
【问题讨论】:
标签: bash