mirror of
				https://github.com/koalaman/shellcheck.git
				synced 2025-10-31 06:29:20 +08:00 
			
		
		
		
	Added check for $(expr 3 + 2)
This commit is contained in:
		| @@ -70,6 +70,7 @@ basicChecks = [ | ||||
|     ,checkFindNameGlob | ||||
|     ,checkGrepRe | ||||
|     ,checkDollarArithmeticCommand | ||||
|     ,checkExpr | ||||
|     ] | ||||
|  | ||||
| modifyMap = modify | ||||
| @@ -177,6 +178,11 @@ checkUuoc (T_Pipeline _ (T_Redirecting _ _ f@(T_SimpleCommand id _ _):_:_)) = | ||||
|                          _ -> return () | ||||
| checkUuoc _ = return () | ||||
|  | ||||
| prop_checkExpr = verify checkExpr "foo=$(expr 3 + 2)" | ||||
| checkExpr (T_SimpleCommand id _ (w:_)) | w `isCommand` "expr" =  | ||||
|     style id "Use $((..)), ${} or [[ ]] in place of antiquated expr." | ||||
| checkExpr _ = return () | ||||
|  | ||||
| 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" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user