bash - Read string from file and convert into an int -


i have txt file number inside; can number, how can read bash , convert int?

as said, thing in file number, no other thing, when reading it, bash gets string.

thanks in advance!

use declare or typeset:

typeset -i variable=$(cat filename) 

Comments