mirror of
https://github.com/koalaman/shellcheck
synced 2025-08-14 02:27:30 -07:00
Suggest grep -c for grep|wc
This commit is contained in:
parent
f9f965693d
commit
f549aad809
1 changed files with 3 additions and 0 deletions
|
@ -477,6 +477,9 @@ checkPipePitfalls _ (T_Pipeline id _ commands) = do
|
|||
for' ["ps", "grep"] $
|
||||
\x -> info x 2009 "Consider using pgrep instead of grepping ps output."
|
||||
|
||||
for' ["grep", "wc"] $
|
||||
\x -> style x 2126 "Consider using grep -c instead of grep|wc."
|
||||
|
||||
didLs <- liftM or . sequence $ [
|
||||
for' ["ls", "grep"] $
|
||||
\x -> warn x 2010 "Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames.",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue