Skip to content

[JENKINS-8449] Shell Task on Windows Slave Uses Incorrect /bin/sh #15552

Closed

Description

@jenkins-infra-bot

At https://github.com/hudson/hudson/blob/master/core/src/main/java/hudson/tasks/Shell.java#L139 the Shell task attempts to detect Windows, and if so, use "sh" instead of "/bin/sh". The problem is that this detection takes place on the Master, instead of on the Slave that is actually going to run the task. If this were fixed to detect correctly, lots of people's workarounds of globally setting the shell as plain "sh" could go away.


Originally reported by ccutrer, imported from: Shell Task on Windows Slave Uses Incorrect /bin/sh
  • status: Resolved
  • priority: Minor
  • component(s): core
  • resolution: Fixed
  • resolved: 2011-03-20T22:33:55+00:00
  • votes: 1
  • watchers: 2
  • imported: 2025-11-24
Raw content of original issue

At https://github.com/hudson/hudson/blob/master/core/src/main/java/hudson/tasks/Shell.java#L139 the Shell task attempts to detect Windows, and if so, use "sh" instead of "/bin/sh". The problem is that this detection takes place on the Master, instead of on the Slave that is actually going to run the task. If this were fixed to detect correctly, lots of people's workarounds of globally setting the shell as plain "sh" could go away.

Activity

  1. jenkins-infra-bot commented on Mar 20, 2011

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Seiji Sogabe
    Path:
    changelog.html
    core/src/main/java/hudson/tasks/Shell.java
    http://jenkins-ci.org/commit/jenkins/415a2729a54bc65c696e06d804bffd658d16b5ea
    Log:
    [FIXED JENKINS-8449] Use correct shell interpreter on Windows slave.

  2. jenkins-infra-bot commented on Mar 24, 2011

    @jenkins-infra-bot
    Author
    dogfood:

    Integrated in jenkins_main_trunk #620

  3. jenkins-infra-bot commented on Apr 22, 2011

    @jenkins-infra-bot
    Author
    dogfood:

    Integrated in jenkins_main_trunk #734
    [FIXED JENKINS-8449] Use correct shell interpreter on Windows slave.

    Kohsuke Kawaguchi : 6d8fd5450a823f0c7abe528bce6a36fd81d2ad5f
    Files :

    • core/src/main/java/hudson/tasks/Shell.java
  4. jenkins-infra-bot commented on Sep 12, 2011

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Seiji Sogabe
    Path:
    changelog.html
    core/src/main/java/hudson/tasks/Shell.java
    http://jenkins-ci.org/commit/jenkins/415a2729a54bc65c696e06d804bffd658d16b5ea
    Log:
    [FIXED JENKINS-8449] Use correct shell interpreter on Windows slave.

  5. jenkins-infra-bot commented on Sep 12, 2011

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Seiji Sogabe
    Path:
    core/src/main/java/hudson/tasks/Shell.java
    http://jenkins-ci.org/commit/jenkins/6d8fd5450a823f0c7abe528bce6a36fd81d2ad5f
    Log:
    [FIXED JENKINS-8449] Use correct shell interpreter on Windows slave.

  6. jenkins-infra-bot commented on Oct 20, 2011

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Seiji Sogabe
    Path:
    core/src/main/java/hudson/tasks/Shell.java
    http://jenkins-ci.org/commit/jenkins/6d8fd5450a823f0c7abe528bce6a36fd81d2ad5f
    Log:
    [FIXED JENKINS-8449] Use correct shell interpreter on Windows slave.

  7. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions