Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-14827

Cannot use /usr/bin/[ as a shell script step: wrapped in "..." after save

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core

      1.479-SNAPSHOT. Create a freeform project, add a shell build step, and enter

      [ -n x ]
      

      for the script. (This should pass.) Now visit config.xml and you will see

          <hudson.tasks.Shell>
            <command>&quot;[ -n x ]&quot;</command>
          </hudson.tasks.Shell>
      

      which is clearly wrong and would fail:

      [test] $ /bin/sh -xe /tmp/hudson123.sh
      + [ -n x ]
      /tmp/hudson123.sh: 2: /tmp/hudson123.sh: [ -n x ]: not found
      Build step 'Execute shell' marked build as failure
      

      Workaround:

      test -n x
      

          [JENKINS-14827] Cannot use /usr/bin/[ as a shell script step: wrapped in "..." after save

          Jesse Glick created issue -
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Assignee New: Kohsuke Kawaguchi [ kohsuke ]
          sogabe made changes -
          Link New: This issue is related to JENKINS-14542 [ JENKINS-14542 ]
          Kohsuke Kawaguchi made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-13856 [ JENKINS-13856 ]
          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-17174 [ JENKINS-17174 ]
          Daniel Beck made changes -
          Link New: This issue is duplicated by JENKINS-12576 [ JENKINS-12576 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 145528 ] New: JNJira + In-Review [ 191530 ]

            kohsuke Kohsuke Kawaguchi
            jglick Jesse Glick
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: