Shell : How to deal with filenames that contain `\n` or ` ` in shell script
<p>I have a shell script like this:</p>

<pre><code>#!/bin/bash
if [ $# -lt 1 ]
then
  echo "Use: "$0" &lt;file_name&gt;"
  echo "Convert files from GBK to UTF8"
  exit
fi

for i in $*

  # Generate temp file to avoid Bus error
  iconv -f GBK -t utf-8 "$i" -o "$i.tmp"
  mv "$i.tmp" "$i"
done
</code></pre>

<p>The problem is <code>$i</code> may contains <code>\n</code>, <code></code> or other wired chars, that makes the script fails to execute(even I've already wrapped it with ""). Is there any way to ignore those characters ?</p>