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

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

    Details

    • Similar Issues:

      Description

      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
      

        Attachments

          Issue Links

            Activity

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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: