title: How to remove \r from the output of a command
body: <p>I'm trying to do a script that uses Docker as much as possible.</p>
  
  <p>Here is an excerpt:</p>
  
  <pre><code>fecha=`docker run -t --rm alpine date +%y-%m-%d_%H-%M`
  tag=$fecha-$var
  </code></pre>
  
  <p>On one hand, it doesn't work because fecha contains a \r character.
  On the other hand this DOES work:</p>
  
  <pre><code>fecha=`date +%y-%m-%d_%H-%M`
  tag=$fecha-$var
  </code></pre>
  
  <p>because I don't receiven a strange '\r' character.</p>
  
  <p>What is the best way of doing this?</p>
  
  <p>I know I could do <code>${fecha//\r/}</code>.</p>