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