ref: https://www.cyberciti.biz/tips/handling-filenames-with-spaces-in-bash.html
#save current ifs singno
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for src_file in `find $rootpath -type f -name "* *" | grep -iE "\.($namefilter)" `; do
echo "src_file=" $src_file
done
IFS=$(echo -en "\n\b")
for src_file in `find $rootpath -type f -name "* *" | grep -iE "\.($namefilter)" `; do
echo "src_file=" $src_file
done
#
IFS=$SAVEIFS
IFS=$SAVEIFS
files=(`ls -1 zip/`)
for file_name in "${files[@]}"; do
echo ${file_name}
# cp -rf zip/${file_name}/src/main src/
done
没有评论:
发表评论