@@ -134,6 +134,8 @@ prop_checkBashisms51= verifyNot checkBashisms "#!/bin/sh\ncmd 2>&1"
134134prop_checkBashisms52= verifyNot checkBashisms " #!/bin/sh\n cmd >&2"
135135prop_checkBashisms53= verifyNot checkBashisms " #!/bin/sh\n printf -- -f\n "
136136prop_checkBashisms54= verify checkBashisms " #!/bin/sh\n foo+=bar"
137+ prop_checkBashisms55= verify checkBashisms " #!/bin/sh\n echo ${@%foo}"
138+ prop_checkBashisms56= verifyNot checkBashisms " #!/bin/sh\n echo ${##}"
137139checkBashisms = ForShell [Sh , Dash ] $ \ t -> do
138140 params <- ask
139141 kludge params t
@@ -295,8 +297,9 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do
295297 (re $ " ^[" ++ varChars ++ " ]+\\ [.*\\ ]$" , " array references are" ),
296298 (re $ " ^![" ++ varChars ++ " ]+\\ [[*@]]$" , " array key expansion is" ),
297299 (re $ " ^![" ++ varChars ++ " ]+[*@]$" , " name matching prefixes are" ),
298- (re $ " ^[" ++ varChars ++ " ]+:[^-=?+]" , " string indexing is" ),
299- (re $ " ^[" ++ varChars ++ " ]+(\\ [.*\\ ])?/" , " string replacement is" )
300+ (re $ " ^[" ++ varChars ++ " *@]+:[^-=?+]" , " string indexing is" ),
301+ (re $ " ^([*@][%#]|#[@*])" , " string operations on $@/$* are" ),
302+ (re $ " ^[" ++ varChars ++ " *@]+(\\ [.*\\ ])?/" , " string replacement is" )
300303 ]
301304 bashVars = [
302305 " LINENO" , " OSTYPE" , " MACHTYPE" , " HOSTTYPE" , " HOSTNAME" ,
0 commit comments