title: passing variable to bash script in a jenkins pipeline job
body: <p>I have a Jenkins pipeline job in which I configure my environment with a bash script named setup.sh which looks like:</p>
  
  <pre><code>#!/bin/bash
  export ARCH=$1
  echo "architecture = " ${ARCH}
  </code></pre>
  
  <p>In the Jenkins pipeline script, Icall the setup.sh script with:</p>
  
  <pre><code>def lib_arch='linux-ubuntu-14.04-x86_64-gcc4.8.4'
  sh ". /opt/setup.sh ${lib_arch}"
  </code></pre>
  
  <p>unfortunately it seems that <em>NO</em> variable is passed to the setup.sh script, and the echo ${ARCH} return an empty string!
  I tried to instead do:
      sh "source /opt/setup.sh ${lib_arch}"
  and this fails as well with the "source not found" message.
  I also tried changing the first line of my script to</p>
  
  <pre><code>#!/bin/sh
  </code></pre>
  
  <p>but it does not help. So how can I pass a parameter to my bash script in a Jenkins pipeline script?
  thanks for your help.</p>
  
  <p>Update:
  a workaround was sugggested by Bert Jan Schrijve in this thread (see below):</p>
  
  <pre><code>sh "bash -c \" source /opt/setup.sh ${lib_arch}\"" 
  </code></pre>