title: Curl (bash) command not working in Jenkinsfile groovy script
body: <p>In my Jenkinsfile Groovy script, I have the following code;</p>
  
  <pre><code>stage('Test the 500 log URLs') {
        steps {
          script {
            echo 'Testing the URLs from the 500 error access log...'
                  sh '''#!/bin/bash
                      while IFS= read -r line; do
                        URL=`echo $line | awk '{print $2}' | sed 's/http:/https:/' `
                        RESULT=`curl -LI $URL -o /dev/null -w "%{http_code}\n" -s | tr -d '[:space:]' `
                        if [[ $RESULT != "200" ]]
                          then
                            echo "$RESULT $URL"   
                        fi
                      done &lt; tests/Smoke/logs_testing/500errors.txt
                    '''
          }
        }
      }
  </code></pre>
  
  <p>The first parts of the file work correctly, including the command;</p>
  
  <pre><code>URL=`echo $line | awk '{print $2}' | sed 's/http:/https:/' `
  </code></pre>
  
  <p>However, the following line; </p>
  
  <pre><code>RESULT=`curl -LI $URL -o /dev/null -w "%{http_code}\n" -s | tr -d '[:space:]' `
  </code></pre>
  
  <p>fails when I run the Jenkins build.</p>
  
  <p>The following error is produced;</p>
  
  <pre><code>line 4: curl: command not found
  </code></pre>
  
  <p>I can't see why the previous line ran ok, but this line is failing.</p>
  
  <p>Is there something obvious I'm missing?</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>thanks</p>