diff --git a/src/ShellCheck/Checks/ShellSupport.hs b/src/ShellCheck/Checks/ShellSupport.hs index 7f30224..b642a20 100644 --- a/src/ShellCheck/Checks/ShellSupport.hs +++ b/src/ShellCheck/Checks/ShellSupport.hs @@ -145,6 +145,7 @@ prop_checkBashisms62 = verify checkBashisms "#!/bin/sh\nexport -f foo" prop_checkBashisms63 = verifyNot checkBashisms "#!/bin/sh\nexport -p" prop_checkBashisms64 = verify checkBashisms "#!/bin/sh\nreadonly -a" prop_checkBashisms65 = verifyNot checkBashisms "#!/bin/sh\nreadonly -p" +prop_checkBashisms66 = verifyNot checkBashisms "#!/bin/sh\necho \"-n foo\"" checkBashisms = ForShell [Sh, Dash] $ \t -> do params <- ask kludge params t @@ -231,7 +232,7 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do warnMsg id "` do warnMsg (getId arg) "echo flags besides -n" else warnMsg (getId arg) "echo flags are" - where argString = concat $ oversimplify arg + where + argString = concat $ oversimplify arg + echoFlags = ["-e", "-E", "-s", "-n"] bashism t@(T_SimpleCommand _ _ (cmd:arg:_)) | t `isCommand` "exec" && "-" `isPrefixOf` concat (oversimplify arg) = warnMsg (getId arg) "exec flags are"