Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What shell does Jenkins use?

Tags:

jenkins

What shell is used in Jenkins when calling the shell command? I'm running Jenkins on a Linux machine.

like image 551
Pablo Jomer Avatar asked Sep 17 '12 08:09

Pablo Jomer


People also ask

Which shell is used in Jenkins?

Jenkins by default looks for sh in the PATH environment variable, however the result (e.g. /bin/sh ) may point to different shells. For example, on Ubuntu 6.10 or later, /bin/sh is a symlink to Dash.

How do I open Jenkins shell?

Jenkins web console > Manage Jenkins > Configure System > Under shell, set the "Shell executable" = C:\cygwin64\bin\sh.exe > Click apply & also click save.


2 Answers

From the help/question mark icon of the "Execute shell" section:

Runs a shell script (defaults to sh, but this is configurable) for building the project.

If you go to Manage Jenkins --> Configure System you will find an option (called "Shell executable") to set the name or absolute path to the shell that you want your shell scripts to use...

For my system without configuring this option... it uses bash!

like image 140
sdmythos_gr Avatar answered Sep 22 '22 23:09

sdmythos_gr


Simply declare your shell on the first line of your script as you do in any shell script file:

#!/bin/bash 
like image 29
Nico Toub Avatar answered Sep 19 '22 23:09

Nico Toub