What shell does Jenkins use?

后端 未结 5 1980
失恋的感觉
失恋的感觉 2020-12-09 07:05

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

5条回答
  •  轮回少年
    2020-12-09 07:44

    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.

    So for the question "what shell is used in Jenkins ...", it depends. To avoid the uncertainty, you can: (take Bash as an example)

    1. Explicitly configure shell executable in Manage Jenkins > Configure System > Shell > Shell executable, e.g., /bin/bash. (system-wide configuration)
    2. Use shebang line to specify the interpreter should be used, e.g., #!/usr/bin/env bash (specific to a job)

提交回复
热议问题