diff --git a/ShellCheck/Analytics.hs b/ShellCheck/Analytics.hs index b7a6a48..16afe21 100644 --- a/ShellCheck/Analytics.hs +++ b/ShellCheck/Analytics.hs @@ -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.",