title: How do I deal with unusual filenames in a command's parameters?
body: <p>I have a file ('list') which contains a large list of filenames, with all kinds of character combinations such as:</p>
  <pre class="lang-none prettyprint-override"><code>-sensei
  </code></pre>
  <p>I am using the following script to process this list of files:</p>
  <pre class="lang-bash prettyprint-override"><code>#!/bin/bash
  while read -r line
  do
      html2text -o ./text/$line $line
  done &lt; list
  </code></pre>
  <p>Which is giving me 'Cannot open input file' errors.
  What is the correct way of dealing with these filenames, to prevent any errors?</p>
  <p>I have changed the example list above to now include only one filename (out of many) which does not work, no matter how I quote or don't quote it.</p>
  <pre class="lang-bash prettyprint-override"><code>#!/bin/bash
  while read -r line
  do
      html2text -o &quot;./text/$line&quot; &quot;$line&quot;
  done &lt; list
  </code></pre>
  <p>The error I get is:</p>
  <pre><code>Unrecognized command line option &quot;-sensei&quot;, try &quot;-help&quot;.
  </code></pre>
  <p>As such <a href="https://stackoverflow.com/questions/10067266/when-should-i-wrap-quotes-around-a-shell-variable">this question</a> does not resolve this issue.</p>