Suggest grep -c for grep|wc

This commit is contained in:
Vidar Holen 2014-04-05 16:53:09 -07:00
parent f9f965693d
commit f549aad809
1 changed files with 3 additions and 0 deletions

View File

@ -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.",