What shell is used in Jenkins when calling the shell
command? I'm running Jenkins on a Linux machine.
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.
Jenkins web console > Manage Jenkins > Configure System > Under shell, set the "Shell executable" = C:\cygwin64\bin\sh.exe > Click apply & also click save.
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!
Simply declare your shell on the first line of your script as you do in any shell script file:
#!/bin/bash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With