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

Warn pipefail does not break in case of a background process #2045

Open
2 tasks done
Li0liQ opened this issue Aug 26, 2020 · 0 comments
Open
2 tasks done

Warn pipefail does not break in case of a background process #2045

Li0liQ opened this issue Aug 26, 2020 · 0 comments

Comments

@Li0liQ
Copy link

Li0liQ commented Aug 26, 2020

For new checks and feature suggestions

Here's a snippet or screenshot that shows the problem:

#!/usr/bin/env bash
set -o pipefail
set -o errexit
false | tee &

Here's what shellcheck currently says:

Nothing.

Here's what I wanted or expected to see:

pipefail will not produce an error in case of a background process. Consider returning an exit code explicitly

#!/usr/bin/env bash
set -o pipefail
set -o errexit
{ 
 false | tee
 exit "${PIPESTATUS[0]}"
} &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant