Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit code is 0 when first command succeeds and second fails #55

Open
nene opened this issue Nov 24, 2016 · 4 comments
Open

Exit code is 0 when first command succeeds and second fails #55

nene opened this issue Nov 24, 2016 · 4 comments

Comments

@nene
Copy link

nene commented Nov 24, 2016

With single command the exit code is as expected:

$ parallelshell "ls asdf"
ls: asdf: No such file or directory
$ echo $?
1

With multiple commands it exits with 1 when the first command exits with 1:

$ parallelshell "ls asdf" "ls ."
asdf: No such file or directory
$ echo $?
1

But when the first command succeeds and second fails, it exits with 0:

$ parallelshell "ls ." "ls asdf"
asdf: No such file or directory
$ echo $?
0

I tried using --wait but then it always exits with 0.

But the documentation says:

If command1 or command2 exit with non-zero exit code, then this will not effect the outcome of your shell (i.e. they can fail and npm/bash/whatever will ignore it). parallelshell will not ignore it, and will exit with the first non-zero exit code.

@nene nene changed the title Exit code Exit code is 0 when first command succeeds and second fails Nov 24, 2016
@darkguy2008 darkguy2008 self-assigned this Oct 18, 2017
@AndyOGo
Copy link

AndyOGo commented Jun 18, 2018

Same issue here

@AndyOGo
Copy link

AndyOGo commented Jun 18, 2018

BTW. the documentation is also misleading, as it claims that exit codes are properly handled.

@andrestaht
Copy link

@AndyOGo we switched to https://github.com/kimmobrunfeldt/concurrently

@AndyOGo
Copy link

AndyOGo commented Jun 18, 2018

@andrestaht
Thanks. I just created a PR for switching to concurrently :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants