title: simple bash script to change spaces to underlines in a file name
body: <pre><code>mv $1 $(echo $1 | sed s:\ :_:g)
  </code></pre>
  
  <p>It's a simple script that renames the file passed as argument, exchanging spaces to underlines. However, when I try to rename the file "a e i" to "a_e_i" for example, it returns the following error:</p>
  
  <pre><code>./spc2und a\ e\ i 
  mv: target `a_e_i' is not a directory
  </code></pre>