Hi, I'm not sure if this is a jenkins issue or a shell issue, but it looks like things work as they should during direct execution from a shell, but not as it should in "Execute shell" inside jenkins.
I made an extremely simple job in jenkins to demonstrate the problem and it only has this as its shell command: #!/bin/csh exit 1 I then run the job and get this on the console: [workspace] $ /bin/csh /tmp/jenkins4977554484883756741.sh Finished: SUCCESS That seems wrong, how can it succeed on exit 1? Running it directly from a shell prints "Exit 1" and "echo $?" prints out "1" so I don't see how the shell itself can be at fault here. Then I do the same thing in jenkins, but change to /bin/sh, i.e. the "Execute shell" is now: #!/bin/sh exit 1 This gives a failing job as one would expect: [workspace] $ /bin/sh /tmp/jenkins4894024285990311119.sh Build step 'Execute shell' marked build as failure Finished: FAILURE I've tried playing around with the -e flag but no difference. Is this some know issue with jenkins+csh or is csh just completely bad? I *think* that this used to work earlier, but may have stopped working in some jenkins upgrade. Not sure though, perhaps it has always been broken. Currently running jenkins 2.164. (and before you ask: using csh is not my choice, but there are some legacy scripts that I'm currently not allowed to port to a more reasonable shell) TIA, Chris -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/946555858.3002423.1550744176179%40mail.yahoo.com. For more options, visit https://groups.google.com/d/optout.
