title: Commands with hadoop work in shell but not in script
body: <p>I am trying to execute a very simple shell script that removes a file if it exists, and then copies a file from hdfs to the local system.</p>
  <pre><code>#!/bin/bash
  rm -f /local/file
  hdfs dfs -get /path/to/hdfs /local/file
  </code></pre>
  <p>Both commands work individually in the terminal, but fail when run as a script. Running</p>
  <pre><code>rm /local/file
  </code></pre>
  <p>fails with
  <code>rm: cannot remove ‘/local/file\r’: No such file or directory</code></p>
  <pre><code>hdfs dfs -get /path/to/hdfs
  </code></pre>
  <p>fails with <code>get: unexpected URISyntaxException</code></p>
  <p>What am I doing wrong here?</p>