Bash-convert-strings-to-int: Difference between revisions
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...") |
mNo edit summary |
||
Line 6: | Line 6: | ||
So the simplest way to convert to an int is simply c=$(($c)) | So the simplest way to convert to an int is simply c=$(($c)) | ||
swiped from [https://linuxhandbook.com/bash-convert-string-to-number/|Source site] | |||
[[Category:bash]] | [[Category:bash]] |
Latest revision as of 11:07, 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))
swiped from site