如: 查找source
目录下的所有匹配*.md
的文件(终端)
$ find ./source/**/*.md
./source/README.md
./source/readme.zh.md
$ sh "find ./source/**/*.md"
sh: find ./source/**/*.md: No such file or directory
or
# find-md.sh
"find ./source/**/*.md"
$ find-md.sh
sh: find ./source/**/*.md: No such file or directory
$(find )
# fix-find.sh
list="$(find ./source -type f -name \*.md)"
echo "$list\n";
$ fix-find.sh
./source/README.md
./source/readme.zh.md
注意: 会有空行
# fix-find.sh
list="$(find ./source -type f -name \*.md)"
for file in $list; do if [ ! -f "$file" ]; then
echo "MISSING: $file"
else
echo "$file";
fi;
done
这样就没有