title: Jenkins Pipeline: Executing a shell script
body: <p>I have create a pipeline like below and please note that I have the script files namely- "backup_grafana.sh" and "gitPush.sh" in source code repository where the Jenkinsfile is present. But I am unable to execute the script because of the following error:-</p>
  
  <pre><code>/home/jenkins/workspace/grafana-backup@tmp/durable-52495dad/script.sh: 
  line 1: backup_grafana.sh: not found
  </code></pre>
  
  <p>Please note that I am running jenkins master on kubernetes in a pod. So copying scripts files as suggested by the error is not possible because the pod may be destroyed and recreated dynamically(in this case with a new pod, my scripts will no longer be available in the jenkins master)</p>
  
  <pre><code>pipeline {
  agent {
      node {
          label 'jenkins-slave-python2.7'
      }
  }
  stages {
      stage('Take the grafana backup') {
          steps {
              sh 'backup_grafana.sh'
          }
      }
      stage('Push to the grafana-backup submodule repository') {
          steps {
              sh 'gitPush.sh'
          }
      }
   }
  }
  </code></pre>
  
  <p>Can you please suggest how can I run these scripts in Jenkinsfile? I would like to also mention that I want to run these scripts on a python slave that I have already created finely.</p>