Shell and Path variable

19 views
Skip to first unread message

Ashish Yadav

unread,
Oct 3, 2016, 4:01:08 PM10/3/16
to Jenkins Users
I created a sample job in Jenkins2.0 to get the SHELL and PATH variables.

Here is the console output:

Started by user admin
Building in workspace /var/lib/jenkins/workspace/path
[path] $ /usr/bin/zsh -xe /tmp/hudson7499585998548354807.sh
+/tmp/hudson7499585998548354807.sh:2> echo /bin/bash
/bin/bash
+ echo /usr/java/jdk1.8.0_101/bin:/usr/java/jdk1.8.0_101/bin:/sbin:/usr/sbin:/bin:/usr/bin
/usr/java/jdk1.8.0_101/bin:/usr/java/jdk1.8.0_101/bin:/sbin:/usr/sbin:/bin:/usr/bin
Finished: SUCCESS


  1. What is the default shell for Jenkins. I asked for zsh but still got /bin/bash
  2. Why am I seeing duplicate entires for JAVA? [/usr/java/jdk1.8.0_101/bin:/usr/java/jdk1.8.0_101/bin]

Matt Potterton

unread,
Oct 3, 2016, 4:09:57 PM10/3/16
to Jenkins Users, ashish...@firemon.com
Have you tried putting #!/usr/bin/zsh at the top of your little jenkins build script?

I imagine the default shell for your jenkins is defined by the settings associated with the user that owns the jenkins process running on your unix system and the duplicate java entries may also be the result of that too (check the .bashrc or .cshrc for your user that owns the jenkins process, maybe someone is populating PATH excessively)
Reply all
Reply to author
Forward
0 new messages