gamma_t=540
gamma_new="$(($gamma_t-360))" # get gamma_new by $gamma_t-360
num2="$(($num1+num2))"
$((expression)) # you can do expressions like this
a=5
yourname_$(($a-1)) #dynamic varibales.
#will give
yourname_4
#!/bin/bash
# Naked variables
echo
# When is a variable "naked", i.e., lacking the '$' in front?
# When it is being assigned, rather than referenced.
# Assignment
a=879
echo "The value of "a" is $a."
# Assignment using 'let'
let a=16+5
echo "The value of "a" is now $a."
echo
# In a 'for' loop (really, a type of disguised assignment):
echo -n "Values of "a" in the loop are: "
for a in 7 8 9 11
do
echo -n "$a "
done
echo
echo
# In a 'read' statement (also a type of assignment):
echo -n "Enter "a" "
read a
echo "The value of "a" is now $a."
echo
exit 0
# Example:
MY_VAR=a # here you assigned the value 'a' to MY_VAR
echo $MY_VAR
echo MY_VAR
# output:
a
MY_VAR
# good practice says to name variable in all caps to differ from commands
# if you want to print to print to console the value of MY_VAR, you must use $
# if you echo without using $, the name of the variable will be printed
# not the value