Para obter todos os nomes de arquivos, você deve confiar em sequências nulas delemitadas:
find /your/path/ -print0 | while read -r -d $'find /your/path/ -print0 | while read -r -d $'%pre%' filename; do
dn="'dirname "$filename"'"
bn="'basename "$filename"'"
bn_clean="'echo "$bn" | tr " \~()&'" "_______"'"
file_clean="$dn/$bn_clean"
if [ "$filename" != "$file_clean" ] ; then
mv -fv "$filename" "$file_clean"
fi
done
' filename; do
dn="'dirname "$filename"'"
bn="'basename "$filename"'"
bn_clean="'echo "$bn" | tr " \~()&'" "_______"'"
file_clean="$dn/$bn_clean"
if [ "$filename" != "$file_clean" ] ; then
mv -fv "$filename" "$file_clean"
fi
done