Check wait flags in dash & POSIX sh

Flags for the wait builtin are undefined under both POSIX sh and dash.
Bash though, accepts [-fn].
This commit is contained in:
Cristian Adrián Ontivero 2019-01-30 11:26:08 +01:00
parent abe6afc09f
commit d3f6e045e2
1 changed files with 3 additions and 1 deletions

View File

@ -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_checkBashisms88 = verifyNot checkBashisms "#!/bin/sh\nset -- wget -o foo 'https://some.url'"
prop_checkBashisms89 = verifyNot checkBashisms "#!/bin/sh\nopts=$-\nset -\"$opts\"" prop_checkBashisms89 = verifyNot checkBashisms "#!/bin/sh\nopts=$-\nset -\"$opts\""
prop_checkBashisms90 = verifyNot checkBashisms "#!/bin/sh\nset -o \"$opt\"" prop_checkBashisms90 = verifyNot checkBashisms "#!/bin/sh\nset -o \"$opt\""
prop_checkBashisms91 = verify checkBashisms "#!/bin/sh\nwait -n"
checkBashisms = ForShell [Sh, Dash] $ \t -> do checkBashisms = ForShell [Sh, Dash] $ \t -> do
params <- ask params <- ask
kludge params t kludge params t
@ -378,7 +379,8 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do
("type", Just []), ("type", Just []),
("ulimit", if isDash then Nothing else Just ["f"]), ("ulimit", if isDash then Nothing else Just ["f"]),
("umask", Just ["S"]), ("umask", Just ["S"]),
("unset", Just ["f", "v"]) ("unset", Just ["f", "v"]),
("wait", Just [])
] ]
bashism t@(T_SourceCommand id src _) = bashism t@(T_SourceCommand id src _) =
let name = fromMaybe "" $ getCommandName src let name = fromMaybe "" $ getCommandName src