Hi,

I'm trying to append a path to env.PATH and then executing a "sh" step.

node('Linux') {
  env.PATH = "/my/path/:${env.PATH}"
  sh 'echo "$PATH"'
}

env.PATH now contains "/my/path:null" and the "sh" will hang (I can see that the temporary script is created successfully in the workspace, but Jenkins does not seem to be able to execute it). No output is generated in the step (just the circular progress indicator will be shown).

When not setting env.PATH everything works as expected and the output will be:
Running shell script
+ echo 'Path: /usr/bin:/bin:/usr/sbin:/sbin'
Path: /usr/bin:/bin:/usr/sbin:/sbin


Changing the above code to:
node('Linux') {
  env.PATH = "/my/path/:/usr/bin:/bin:/usr/sbin:/sbin"
  sh 'echo "$PATH"'
}

will solve the problem. Is this expected behaviour?

Thanks
Christoph


--
You received this message because you are subscribed to the Google Groups "Jenkins 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ff67138eab3920758880de6a24d88eae%40kfpc.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to