1. ${ }
A more precise range of defined variable names is used for variable substitution
For example:
A=b
Echo $AB
Originally intended to replace the result of a $ A and then a B-letter followed, but on the command line, the real result is only replace the value of the variable name is AB out.
Using ${} is no problem:
Echo ${a}b
Get Results BB
2. $ (())
The purpose of $ (()): It is used for integer arithmetic.
In bash, the integer operation symbol for $ (()) roughly has these:
+-*/: "Add, subtract, multiply, divide" respectively.
%: Remainder operation
& | ^!: "And, or, XOR, not", respectively
General Examples:
#!/bin/bash//bash Interpreter
I=1
while ((i<10));d o
J=1
while ((j<=i)); Do
Echo-ne ${j}x${i}=$ ((i*j)) '/t '//-ne not wrapped, parsing escape characters in anti-quote '
j=$ ((j+1))
Done
echo//Echo Wrap
i=$ ((i+1))
Done
The difference between ${} and $ (()) in shell scripts. ${} Qualifying variable Boundary $ (()) subtraction operation