I want to store this value 3.4.1 as 3004001 so 3*1,000,000 + 4*1,000 + 1
I want to do this is a bash script how can I do that?
I want to store this value 3.4.1 as 3004001 so 3*1,000,000 + 4*1,000 + 1
I want to do this is a bash script how can I do that?
val="3.4.1"
awk -F. '{ print ($1*1000000)+($2*1000+1) }' <<< $val
Use awk to split the data with field delimiter . and then perform the necessary math printing the result.