Bash-convert-strings-to-int

From I Will Fear No Evil
Jump to navigation Jump to search

In bash converting string values into integer values can be done this way:

c=$(( A+b ))
Anything within the (( )) is considered arithmetic

So the simplest way to convert to an int is simply c=$(($c))

swiped from site