line 11: $file ./recreated/${\{\}%%/}: bad substitution
#!/bin/bash
TMP_IFS=`echo $IFS`
export IFS=`echo -e "\n\r"`
dir1list=(`ls -1R ./dir1`)
export IFS=$TMP_IFS
echo "" > ./log
for file in ${dir1[*]};do
echo "Searching for: $file" >> ./log
find ./dir2 -name "$file" -exec cp -v --parents $file
./recreated/_тутнадочтото_ \; >> ./log
done;
