I'd like to convert all my work on a LaTeX book from ISO8859-1 to UTF-8.
I found a script that I would like to adapt. So here's what I wrote :
# start encoding
encodeFrom='ISO-8859-1'
# target encoding
encodeTo='UTF-8'
# finding files whose extensions correspond to the given parameter
for filename in ` find . -type f -name *.{$1}`
do
echo $filename
# saving source file
mv $filename $filename.save
# convert file
iconv -f $encodeFrom -t $encodeTo $filename.save -o $filename
# check that file is in unix mode
dos2unix $filename
done
Problem is : the 'find' command doesn't work : testing it with "set -v", I get :
find . -type f -name *.{$1}
What did I do wrong ? I tried to find my way threw a bash book (as a matter of fact, two :-), but couldn't find a solution.
Even trying for just tex files conversions :
for filename in ` find . -type f -name *.tex`
I get :
find: les chemins doivent précéder l'expression : arithmetique.tex
[solved]