title: groovy escape double quoted $
body: <p>I have this shell script running in a Jenkins pipeline</p>
  
  <pre><code>def planResults = sh(returnStdout: true, script: "cd $it; PLAN=\$(terragrunt plan --terragrunt-source-update | landscape); echo "$PLAN"; CHANGES=$(echo "$PLAN" | tail -2); echo $CHANGES")
  </code></pre>
  
  <p>The issue is when I try to echo the "$PLAN" variables.</p>
  
  <p>Here is the solution that groovy recommends, which works near where PLAN is set at \$(terragrunt, however it does not work for a $ inside double quotes. And I NEED double quotes for this command to work properly.</p>
  
  <pre><code>solution: either escape a literal dollar sign "\$5" or bracket the value 
  expression "${5}" @ line 34, column 148.
  ce-update | landscape); echo "$PLAN"; CH
  </code></pre>
  
  <p>Thank you!</p>