From d3f6e045e2e80eb350650a77734b047927ee7db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Adri=C3=A1n=20Ontivero?= Date: Wed, 30 Jan 2019 11:26:08 +0100 Subject: [PATCH] Check wait flags in dash & POSIX sh Flags for the wait builtin are undefined under both POSIX sh and dash. Bash though, accepts [-fn]. --- src/ShellCheck/Checks/ShellSupport.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ShellCheck/Checks/ShellSupport.hs b/src/ShellCheck/Checks/ShellSupport.hs index 9b65ce7..de9efc8 100644 --- a/src/ShellCheck/Checks/ShellSupport.hs +++ b/src/ShellCheck/Checks/ShellSupport.hs @@ -171,6 +171,7 @@ prop_checkBashisms87 = verify checkBashisms "#!/bin/sh\nset -o emacs" prop_checkBashisms88 = verifyNot checkBashisms "#!/bin/sh\nset -- wget -o foo 'https://some.url'" prop_checkBashisms89 = verifyNot checkBashisms "#!/bin/sh\nopts=$-\nset -\"$opts\"" prop_checkBashisms90 = verifyNot checkBashisms "#!/bin/sh\nset -o \"$opt\"" +prop_checkBashisms91 = verify checkBashisms "#!/bin/sh\nwait -n" checkBashisms = ForShell [Sh, Dash] $ \t -> do params <- ask kludge params t @@ -378,7 +379,8 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do ("type", Just []), ("ulimit", if isDash then Nothing else Just ["f"]), ("umask", Just ["S"]), - ("unset", Just ["f", "v"]) + ("unset", Just ["f", "v"]), + ("wait", Just []) ] bashism t@(T_SourceCommand id src _) = let name = fromMaybe "" $ getCommandName src