Curl (bash) command not working in Jenkinsfile groovy script
问题 In my Jenkinsfile Groovy script, I have the following 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 < tests/Smoke/logs_testing/500errors.txt ''' } } } The first parts of the file work