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 when using pipes in commands #241

Open
mcandre opened this issue Jan 11, 2024 · 0 comments
Open

Warn when using pipes in commands #241

mcandre opened this issue Jan 11, 2024 · 0 comments

Comments

@mcandre
Copy link
Owner

mcandre commented Jan 11, 2024

By default, sh may not respect exit codes of commands leading up to the final pipe command.

An explicit set -o pipefail may be required. However, that is unfortunately not currently supported by POSIX sh.

Encourage explicitly performing set -o pipefail && prior to each piping rule command, or moving the complex command to a dedicated shell script.

Take care to avoid false positives, when the pipe symbol is passed in a double or single quoted command argument. Perhaps we keep the scan simple and ignore the false negative of an escaped pipe string literal.

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