title: Jenkins - execute script on different machine with local env variables
body: <p>Have:</p>
  
  <ol>
  <li><p>Jenkins job that needs to execute bash command and initialise variable locally:</p>
  
  <p>GOOD_VARIABLE=<code>command</code></p></li>
  <li><p>SSH into remote host and execute another command with above variable</p>
  
  <p><code>command ${GOOD_VARIABLE}...</code></p></li>
  </ol>
  
  <p>Problem:</p>
  
  <p>I know how to ssh into another machine and execute command there but how can I pass that <strong><em>local</em></strong> variable to remote host?</p>
  
  <p>Tried but didn't work:</p>
  
  <ul>
  <li>Pre build script</li>
  <li>Inject environment variables to the build process</li>
  </ul>