$(( <EXPRESSION> )) $[ <EXPRESSION> ]
The arithmetic expression <EXPRESSION> is evaluated and the resulting value replaces the whole $((...)) construct:
Please do not use the second form $[ ... ]! It's deprecated. The preferred and standardized form is $(( ... ))!
read -p "Enter first operand: " first read -p "Enter second operand: " second echo "The sum is $((first + second))"
Note that in Bash you don't need the arithmetic expansion to simply check for a specific value of an integer, this can be done using the arithmetic evaluation compound command:
read -p "Enter a number: " if ((number == 1234)); then echo "Good guess" else echo "Haha... :-P" fi
Discussion