title: jenkins pipeline sh adding new line
body: <p>My pipeline sh block:</p>
  
  <pre><code> sh "set +e; /terraform/terraform plan -var aws_access_key=${aws_access_key} -
   var aws_secret_key=${aws_secret_key} -var aws_ami=${ami_id} -var 
   aws_instance_type=${instance_type} -var aws_elb_security_group=${elb_sg} -var 
   aws_ec2_security_group=${ec2_sg} -detailed-exitcode; echo \$? &gt; status"
                exitCode = readFile('status').trim()
                echo "Terraform Plan Exit Code: ${exitCode}"
  </code></pre>
  
  <p>output : </p>
  
  <pre><code>+ set +e
  + /terraform/terraform plan -var aws_access_key=**** -var aws_secret_key=**** -var aws_ami=ami-xxxxxxx
  + -var aws_instance_type=t2.medium -var aws_elb_security_group=sg-xxxx
  /terraform/selectdev/int/mp-frontend@tmp/durable-6c57c14c/script.sh: line 3: -var: command not found
  + -var aws_ec2_security_group=sg-axxx
   /terraform/selectdev/int/mp-frontend@tmp/durable-6c57c14c/script.sh: line 4: -var: command not found
  + -detailed-exitcode
  /terraform/selectdev/int/mp-frontend@tmp/durable-6c57c14c/script.sh: line 5: 
   -detailed-exitcode: command not found
  + echo 127
  </code></pre>
  
  <p>I'm not sure why new line is being added to the command and If I do single quotes like sh '', variables are blank. what am I doing wrong ?</p>
  
  <p>I tried to do like below but it too adding new lines</p>
  
  <pre><code>def command = $/....../$
  res = sh(returnStdout: true, script: command)
  </code></pre>