$/${} is unnecessary on arithmetic variables
Inside `$(( ... ))`, Bash already evaluates bare variable names. The leading `
Problem
Bash's arithmetic context (`(( ))` and `$(( ))`) treats unprefixed identifiers as numeric variables automatically. Writing `$var` inside arithmetic still works but adds visual noise and obscures the fact that you're in an evaluator that already understands names.
Bad
i=1
result=$(( $i + 1 ))
(( $count > 0 )) && echo "yes"Good
i=1
result=$(( i + 1 ))
(( count > 0 )) && echo "yes"Explanation
Drop the dollar inside arithmetic. The exception is when you genuinely want command substitution: `(( $(wc -l < file) > 100 ))` — there the `$()` is required, not the variable form.
When It Matters
Inside (( )) and $(( )) the shell already treats bare words as variable names, so $ is redundant. Worse, it changes the parse in edge cases: $ forces one round of expansion before arithmetic evaluation, which means an empty variable becomes a syntax error rather than zero, and array indices behave differently. Dropping the sigil makes arithmetic read like arithmetic, and makes the difference between a variable and a string literal visible.
Second Example
Note
An unset or empty variable evaluates as 0 in arithmetic context when written bare, which is usually the forgiving behaviour you want.
Exceptions
Positional parameters ($1, $2) and special parameters ($#, $?) do need the dollar sign, and array element expansions read more clearly with braces. ShellCheck accounts for these, so a remaining warning usually means the sigil really is redundant.
Faq
Q
Does (( )) return a useful exit status?
A
Yes, and it is inverted relative to C: an arithmetic result of zero gives exit status 1 (false), anything else gives 0 (true). That is what makes (( x > 3 )) work as a condition.
Q
Is (( )) POSIX?
A
No. $(( )) arithmetic expansion is POSIX; the standalone (( )) command is a Bash and ksh extension. In sh use : $(( ... )) or the test builtin.
Q
What happens with a non-numeric value?
A
Bash tries to interpret the string as an arithmetic expression, which can recursively expand variable names. Validate untrusted input before putting it in arithmetic context.