What shell is used in Jenkins when calling the shell
command? I\'m running Jenkins on a Linux machine.
You can set the default shell using Jenkins > Manage Jenkins > Configure System > Shell executable.
For jobs that use a shell different from the default, begin the Execute shell build step with a shebang, such as:
#!/usr/bin/tcsh -e -x
command1
command2
...
You can even use /usr/bin/env
to use, say, Python:
#!/usr/bin/env python3
Beware that a space is not allowed after the #!
:
#! /usr/bin/tcsh # Wrong
This will give the error,
java.io.IOException: Cannot run program ""
I tested the above on Jenkins 1.625.3