no-ps-grep
What it does
Section titled “What it does”Reports a pipeline from ps into grep.
Why it matters
Section titled “Why it matters”ps | grep name also matches the grep process itself, and any process whose command line contains the text, so the test is true when nothing runs.
To fix, use pgrep name.
Example
Section titled “Example”...trap 'rm $tmp' EXITtrap "echo bye" EXIT...ps aux | grep nginx...Configuration
Section titled “Configuration”shell: lint: rules: no-ps-grep: warn # off (default), warn, errorEnabled by the presets: shell/shellcheck.
Suppress one line with sudsy-disable-next-line no-ps-grep in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| shellcheck | SC2009 |
full |