title: EOF: command not found in Jenkins Pipeline
body: <p>I'm trying to launch Datadog agent in Jenkins pipeline, but I'm getting below errors:</p>
  <p><strong>line 7: warning: here-document at line 2 delimited by end-of-file (wanted `EOF').
  EOF: Command not found Error.</strong></p>
  <pre><code>    stage('Install Datadog agent'){
          when {
              environment(name: &quot;DATADOG_REQ&quot;, value: &quot;enable&quot;)
              }
          steps {
              script {
              echo &quot;Installing Datadog Agent&quot;
              
              sh '''#!/bin/bash 
                  ssh -o ConnectTimeout=30 -t  ABC@1234 /bin/bash  &lt;&lt; EOF || error_exit &quot;creating based folder failed for $service_name&quot;
                  sudo chmod u+x ./${JOB_NAME}/enableDatadogAgent.sh
                  sudo chown jenkins:jenkins ./${JOB_NAME}/enableDatadogAgent.sh
                  echo ${DATADOG_REQ} ${JOB_NAME}
                  ./${JOB_NAME}/enableDatadogAgent.sh ${DATADOG_REQ} 
                  EOF'''
                  }
  
  
  
              }
          }
  </code></pre>
  <p>Any help would be very helpful.</p>