mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-09-22 03:45:41 +08:00
Suggest pgrep when grepping ps
This commit is contained in:
@@ -364,6 +364,9 @@ checkPipePitfalls (T_Pipeline id commands) = do
|
|||||||
for ["?", "echo"] $
|
for ["?", "echo"] $
|
||||||
\(_:echo:_) -> info (getId echo) "echo doesn't read from stdin, are you sure you should be piping to it?"
|
\(_:echo:_) -> info (getId echo) "echo doesn't read from stdin, are you sure you should be piping to it?"
|
||||||
|
|
||||||
|
for' ["ps", "grep"] $
|
||||||
|
flip info "Consider using pgrep instead of grepping ps output."
|
||||||
|
|
||||||
didLs <- liftM or . sequence $ [
|
didLs <- liftM or . sequence $ [
|
||||||
for' ["ls", "grep"] $
|
for' ["ls", "grep"] $
|
||||||
flip warn "Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames.",
|
flip warn "Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames.",
|
||||||
|
Reference in New Issue
Block a user