title: Bash scripts have strange special characters in them
body: <p>I am storing bash scripts onto a CentOS server from <code>PHP</code> over <code>SSH2</code>; I know it is complicated, but just bear with me.</p>
  
  <p>When I open up the file (on the server):</p>
  
  <pre><code>vi myScript
  </code></pre>
  
  <p>I see:</p>
  
  <pre><code>ls -al^M
  free -m
  </code></pre>
  
  <p>So, when I try an execute it with:</p>
  
  <pre><code>bash myScript
  </code></pre>
  
  <p>The output throws an error:</p>
  
  <pre><code>ls: invalid option -- 
  Try `ls --help' for more information.
           total       used       free     shared    buffers     cached
  Mem:           676        642         34          0         33        313
  -/+ buffers/cache:        295        380
  Swap:          767          1        766
  </code></pre>
  
  <p>What is the <code>^M</code> and any idea where it is coming from? The bash script should to be able to support newlines and tabs.</p>
  
  <p>Thanks.</p>