title: Bash programmation (Cygwin): Illegal Character ^M
body: <p>I have a problem with a character. I think it's a conversion problem between dos and unix.</p>
  
  <p>I have a variable that is a float value.
  When I print it with the echo command i get:</p>
  
  <pre><code>0.495959
  </code></pre>
  
  <p>But when I try to make an operation on that value with the bc command (I am not sure how to write the bc command).</p>
  
  <pre><code>echo $mean *1000 |bc
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>(standard_in) 1 : illegal character: ^M
  </code></pre>
  
  <p>I already use the dos2unix command on my .sh file.
  I think it's because my variable have the ^M character (not printed with the echo command)</p>
  
  <p>How can i eliminate this error?</p>