title: Set value to environment variable and use in conditional plugin in Jenkins
body: <p>I have a small batch code which prints the License information of a executable to a file <code>version.txt</code> and does a check whether the License is <code>Product is licensed to MyOrg</code>. If they are not equal, I explicitly throw <code>exit 1</code> and fail the build, else echo the value of the variable. Below is the working code.</p>
  
  <pre><code>@echo off
  product_executable --version 1&gt;version.txt 2&gt;&amp;1
  FOR /F "SKIP=1 TOKENS=*" %%L IN (version.txt) DO set checkstr=%%L
  del /q /f version.txt
  if NOT "%checkstr%"=="Product is licensed to MyOrg" ( EXIT 1 ) else ( ECHO %checkstr% )
  </code></pre>
  
  <p>But what I need is, instead of saving the variable to the file and reading lines from it and deleting the file, I want to save it to a environment variable say <code>license_info</code> and access it in the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Conditional+BuildStep+Plugin" rel="nofollow">Conditional Build Step</a> plugin like <code>${license_info}</code>. But I am unable to do so. </p>