title: Capture output of command which contains quotes and env vars
body: <p>I know I can capture the output of a bash command like this:</p>
  
  <pre><code>OUTPUT="$(ls -1)"
  echo "${OUTPUT}"
  </code></pre>
  
  <p>But my command itself contains a lot of quotes:</p>
  
  <pre><code>OUTPUT="$(curl -v -u ${USER}:${PASSWD} -X POST -H "Content-Type: application/json" -d '{
  "xxx": true,
  "xxx2": "date",
  ...
  }' https://${ENV}/${ROOT}/api/try)"
  </code></pre>
  
  <p>but this returns an empty string:    </p>
  
  <pre><code>echo $OUTPUT
  </code></pre>
  
  <p>How can I capture the output of this command?</p>