I've tried to change filenames using following script:
find dir/ -type f -exec mv {} $(echo {} | iconv -f UTF8 -t ASCII//TRANSLIT ) \;
Why doesn't it work? I mean when I have a file with character like 'ą' it should convert it to 'a'.
$ echo ążźćó | iconv -f UTF8 -t ASCII//TRANSLIT
azzco
why does it not work in find -exec?
$ find dir/ -type f -exec mv {} $(echo {} | iconv -f UTF8 -t ASCII//TRANSLIT ) \;
mv: `dir/zią' and `dir/zią' are the same file
I get the same results using xargs:
$ find dir/ -type f | xargs -I{} echo {} | iconv -f UTF8 -t ASCII//TRANSLIT
dir/zia
but:
$ find dir/ -type f | xargs -I{} mv {} $(echo {} | iconv -f UTF8 -t ASCII//TRANSLIT)
mv: `dir/zią' and `dir/zią' are the same file