From 100fff48350ae6f85aeea01c764ab0058e9e0478 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Tue, 27 Nov 2012 01:21:14 -0800 Subject: [PATCH] Added grep | sed check like existing grep | awk. --- ShellCheck/Analytics.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/ShellCheck/Analytics.hs b/ShellCheck/Analytics.hs index 4b80161..930e944 100644 --- a/ShellCheck/Analytics.hs +++ b/ShellCheck/Analytics.hs @@ -170,6 +170,7 @@ prop_checkPipePitfalls1 = verify checkPipePitfalls "foo | grep foo | awk bar" prop_checkPipePitfalls2 = verifyNot checkPipePitfalls "foo | awk bar | grep foo" prop_checkPipePitfalls3 = verify checkPipePitfalls "ls | grep -v mp3" checkPipePitfalls (T_Pipeline id commands) = do + for [["grep"], ["sed"]] $ \id -> style id "You don't need grep | sed, sed can filter lines by itself." for [["grep"], ["awk"]] $ \id -> style id "You don't need grep | awk, awk can filter lines by itself." for [["ls"], ["?"]] $ \id -> warn id "Don't parse ls output; it mangles filenames." for [["ls"], ["grep"]] $ \id -> warn id "Don't use ls | grep. Use a for loop with a condition in it."