Shell redirect causes exit code 0

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

XMLWordPrintable

      Running a `sh()` step that has `&>` or any redirect causes the command to work even if the command should fail. It also doesn't appear that the command is running at all. 

      So `sh('FakeNews &> test.log')` outputs the `command not found` error to the console instead of the file. Creates an empty `test.log` and the build passes even though it should have failed. But `sh('FakeNews')` causes exception FakeNews: command not found. This is a more recent issue (last 4 months or so) didn't see this before that.

      I had originally created this bug as a docker issue but I'm seeing it on our updated AWS instances as well.

            Assignee:
            Unassigned
            Reporter:
            Levi Blaney
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: