Bash-convert-strings-to-int

From I Will Fear No Evil
Revision as of 12:01, 22 November 2021 by Chubbard (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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))