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

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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
      

            Assignee:
            Kohsuke Kawaguchi
            Reporter:
            Jesse Glick
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: