title: `docker run` output to bash variable - strange behaviour
body: <p>I'm seeing some strange behaviour getting the output from <code>docker run</code> into a bash variable.</p>
  
  <p>Simple example:</p>
  
  <pre><code>#!/bin/bash
  
  PWD=$(docker run --rm -ti ubuntu pwd 2&gt;&amp;1)
  # also tried with PWD=`docker run ...` with same behaviour
  echo $PWD
  echo abc $PWD
  echo abc $PWD xyz
  </code></pre>
  
  <p>output</p>
  
  <pre><code>/
  abc /
   xyz/
  </code></pre>
  
  <p>The problem is on the last <code>echo</code>...</p>