title: How to execute a file that is placed in Shared library resource folder from groovy script iwhich is in the same shared library using Jenkins
body: <p>I tried with the following</p>
  
  <pre><code>def scriptText = libraryResource 'path/to/myfile.sh' 
  writeFile file:'myfile.sh', text: scriptText
  
  sh "chmod +x myfile.sh"
  sh "myfile.sh" // errors out with #home/jenkins/testing@tmp/durable-889hb/script.sh: line 1: myfile.sh: not found
  </code></pre>
  
  <p>Could someone suggest on is that Im missing something or whats the actual way to execute the file from resource folder from Jenkins.</p>