title: Passing variables extracted from shell in Jenkinsfile
body: <p>I am trying to pass variables extracted in a stage in Jenkinsfile between stages. For example:</p>
  
  <pre><code>   stage('Dummy Stage') {
      sh '''#!/bin/bash -l
          export abc=`output of some command`
          .....
          .....
         '''
  </code></pre>
  
  <p>Now, how can I pass the variable abc to a subsequent stage? I have tried setting the variable by adding a def section at the top of the file but looks like it doesnt work. In the absence of a neater way, I am having to retype the commands </p>