Suppose two numbers are stored in two different files. a.txt and b.txt. Each number say large enough(more than 30 digit) not to be supported by data types. So how to add them in bash shell.?
Assuming they are decimal numbers, You could do:
Beware that
|
||||
|
The trick is to not use First, read each number into a separate variable. This assumes that the files contain only a number and no other information.
Then use the
To store the result in a variable
If the
And storing the result in
|
|||||||||||||
|
python
or similar in that case. – phk 17 hours ago