title: Jenkins Shell Script variable assignment fails when parsing curl response
body: <p>i have a curl statement that i run in a shell script in the Jenkins Execute Shell Script plugin, that will return a json object:    {"request_id":"52d4520c09228dc810000096"}.</p>
  
  <p>Curl statement runs fine and returns the proper response json object.</p>
  
  <p>I need to parse this object and get the value back to use as a parameter for the next Jenkins Job. Currently using tr and cut to parse the json response.</p>
  
  <p>When i try this code it fails:</p>
  
  <pre><code>    curl -s -X POST -H "Accept:application/json" -d "{my parameters}" http://my_http_post_url | tr -d '{}"' | cut -f 2 -d ':' - &gt; ${response_id};
  </code></pre>
  
  <p>Fails with:</p>
  
  <pre><code>    cannot create : Directory nonexistent
      + cut -f 2 -d : -
      + curl -s -X POST -H Accept:application/json -d {my params} http://my_http_post_url
      tr: write error: Broken pipe
      Build step 'Execute shell' marked build as failure
  </code></pre>
  
  <p>Also tried this:</p>
  
  <pre><code>    ${response_id}=$(curl -s -X POST -H "Accept:application/json" -d "{my parameters}" http://my_http_post_url | tr -d '{}"' | cut -f 2 -d ':');
  </code></pre>
  
  <p>Fails with (note: 52d4520c09228dc810000096 is the proper response id):</p>
  
  <pre><code>    + cut -f 2 -d :
      + curl -s -X POST -H Accept:application/json -d {my params} http://my_http_post_url
      + tr -d {}"
      + = 52d4520c09228dc810000096
      /tmp/hudson3217430586060280102.sh: 2: /tmp/hudson3217430586060280102.sh: = 52d4520c09228dc810000096: not found
      Build step 'Execute shell' marked build as failure
  </code></pre>