title: Bash script for encoding conversion
body: <p>I'd like to convert all my work on a LaTeX book from ISO8859-1 to UTF-8.</p>
  
  <p>I found a script that I would like to adapt. So here's what I wrote :</p>
  
  <pre><code># 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
  </code></pre>
  
  <p>Problem is : the 'find' command doesn't work : testing it with "set -v", I get :</p>
  
  <pre><code>find . -type f -name *.{$1}
  </code></pre>
  
  <p>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.</p>
  
  <p>Even trying for just tex files conversions :</p>
  
  <pre><code>for filename in ` find . -type f -name *.tex`
  </code></pre>
  
  <p>I get :</p>
  
  <pre><code>find: les chemins doivent précéder l'expression : arithmetique.tex
  </code></pre>