Re: [question] && chaining vs shell loops

2015-03-29 Thread Max Kirillov
On Sun, Mar 29, 2015 at 8:43 PM, Jeff King wrote: > In our test scripts, it is also OK to just "return 1", because > the test snippets execute inside a function. Thanks, sounds like a plan. -- Max -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majo

Re: [question] && chaining vs shell loops

2015-03-29 Thread Jeff King
On Sun, Mar 29, 2015 at 06:07:39PM +0200, Andreas Schwab wrote: > Max Kirillov writes: > > > As far as I can see, loops in shell ignore non-zero exit > > codes of the bodies which are not last. For example, exit > > code of command 'for f in false true; do $f; done' is 0, > > even if there was f

Re: [question] && chaining vs shell loops

2015-03-29 Thread Andreas Schwab
Max Kirillov writes: > As far as I can see, loops in shell ignore non-zero exit > codes of the bodies which are not last. For example, exit > code of command 'for f in false true; do $f; done' is 0, > even if there was false. There is nothing special with loops, that's how the exit code of compo

[question] && chaining vs shell loops

2015-03-29 Thread Max Kirillov
Hi. As far as I can see, loops in shell ignore non-zero exit codes of the bodies which are not last. For example, exit code of command 'for f in false true; do $f; done' is 0, even if there was false. How should one workaround it in test scripts, is there any established approach? -- Max -- To