Vino, thanks for the quick reply, but I couldn't get any result yet.
I have written your script in the following form, making the test for replacing all the z letters with d letters
#! /bin/sh
for file in `find /tmp/ -name '*.'`
do
PATH=${file%/}
FILE_OLD=${file#$PATH}
FILE_NEW={FILE_OLD//<z>/<d>}
mv ${PATH}/${file} ${PATH}/${FILE_NEW}
done
The script doesn't give any error but also doesn't replace any charecters.
# Transcodification table
Trans_table="�=oe,�=ae"
# Build sed script to do file name transcodification
sed_file=/tmp/$$.sed
echo "$Trans_table" | tr '=,' ' \n' |
while read from to
do
echo "s/$from/$to/g"
done > $sed_file
# Rename all files in the system
for file in `find /`
do
path=`dirname $file`
file_old=`basename $file`
file_new=`echo $file_old | sed -f $sed_file`
[ "$file_old" != "$file_new" ] && mv $path/$file_old $path/$file_new
done
rm -f $sed_fil