It uses the default shell, yes - i.e., "sh -c ...", as you can see at https://github.com/jenkinsci/durable-task-plugin/blob/c1ee6607c6939e8917762419c8474fecec06172c/src/main/java/org/jenkinsci/plugins/durabletask/BourneShellScript.java#L141-L165. The actual content of the step, i.e., "ls -la" in "sh('ls -la')", though, gets written to a file on the agent, and then that file is executed. So "#!/bin/bash" should have done the trick...
A. On Wed, Sep 26, 2018 at 2:33 PM Meg Watson <[email protected]> wrote: > Hi there, > > I have a Jenkins Master on RHEL (v 2.121.3), and an Agent running on > NonStop, which looks and smells like Unix. On NonStop I have 2 choices for > the shell, /bin/sh (which is symlinked to /bin/ksh) and /bin/bash. I > normally use /bin/bash. I have a pipeline job that is pegged to run on the > NonStop Agent (via node ()) with a pipeline declarative script. One of the > steps is an sh with several lines. Problem is, the shell run by the sh > step is /bin/sh. I cannot figure out how to change it. I tried > #!/bin/bash as the first line of the sh step, but to no avail. It seems > like the agent may be assuming /bin/sh when executing the sh step. Any > ideas on how I can change the script used by the sh step in the pipeline? > > Declarative Pipeline Plugin 1.3.1; Pipeline: Nodes and Processes Plugin > 2.19 > > Thanks in advance! > > Meg > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/923a2542-30e3-4ec6-b0f0-e142f0b5f439%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/923a2542-30e3-4ec6-b0f0-e142f0b5f439%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPbPdObokWagEO5gUT_XV6SXCR1wcYe9ho4ubbpYrBztPbWBwg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
