Bash-convert-strings-to-int: Difference between revisions

From I Will Fear No Evil
Jump to navigation Jump to search
(Created page with "In bash converting string values into integer values can be done this way: <pre> c=$(( A+b )) Anything within the (( )) is considered arithmetic </pre> So the simplest way to...")
(No difference)

Revision as of 12:01, 22 November 2021

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))