Duas maneiras de remover caracteres com diacríticos em um script de shell:
chars="äéėèêß○‡€"
echo -n "$chars" | iconv -c -f utf-8 -t us-ascii//TRANSLIT | tr -d "\"\'^'"
#=> aeeeessEUR
echo -n "$chars" | sed 's|ä|ae|g;s|ß|ss|g' | tr -C 'touch ~/Desktop/test\ {ää,öö}.txt
find ~/Desktop/ -maxdepth 1 -iname "test*" |
while read f; do
mv "$f" "$(tr -C 'chars="äéėèêß○‡€"
echo -n "$chars" | iconv -c -f utf-8 -t us-ascii//TRANSLIT | tr -d "\"\'^'"
#=> aeeeessEUR
echo -n "$chars" | sed 's|ä|ae|g;s|ß|ss|g' | tr -C 'touch ~/Desktop/test\ {ää,öö}.txt
find ~/Desktop/ -maxdepth 1 -iname "test*" |
while read f; do
mv "$f" "$(tr -C '%pre%0-0' '_' <<< "$f")"
done
0-0' '_'
#=> ae____ss___
0-0' '_' <<< "$f")"
done
0-0' '_'
#=> ae____ss___
Renomear em lote os arquivos depois de encontrá-los recursivamente:
%pre%