title: Unable to run shell script inside Jenkins pipeline
body: <p>I'm able to run the following shell script but couldn't run from Jenkins pipeline code.</p>
  
  <p><strong>Try 1.</strong></p>
  
  <pre><code>node('buildnode') {
  
  def value = "Myvalue"
  
  def key = "Mykey"
  
  sh '''
  
  DATA=$(printf "%-50s \"$key\"" "$value")
  
  echo "$DATA"
  
  '''
  
  }
  </code></pre>
  
  <p><strong>output:</strong></p>
  
  <pre><code>++ printf '%-50s ' ''
  + DATA=' 
  </code></pre>
  
  <p><strong>Try 2:</strong></p>
  
  <p>Tried with sh " " "</p>
  
  <pre><code>DATA=$(printf "%-50s \"$key\"" "$value")
  
  echo "$DATA"
  
  " " "
  </code></pre>
  
  <p><strong>output:</strong> :</p>
  
  <blockquote>
    <p>illegal string body character after dollar sign;
       solution: either escape a literal dollar sign <code>"\$5"</code> or bracket the value expression <code>"${5}"</code></p>
  </blockquote>
  
  <p>Can someone help me?</p>