vieyahn2017 / shellv

shell command test and study
4 stars 1 forks source link

shell脚本 过滤出对应目录下的所有png文件名 #1

Closed vieyahn2017 closed 5 years ago

vieyahn2017 commented 6 years ago

shell脚本 过滤出对应目录下的所有png文件名

str=("path1" "path2" "path3")  
for s in ${str[@]}; do  
    for file in `find "$s" -name *.png`; do  
        fileName=${file##*/}  
        echo ${fileName%%.*} >> extra  
    done  
done  
vieyahn2017 commented 6 years ago

for循环里面还有问题