1
rated 0 times
[
1]
[
0]
/ answers: 1 / hits: 1783
/ 3 Years ago, sat, june 12, 2021, 2:01:55
This will sound pretty awkward for some of you. Suppose I have a string which represents some $((expression))
, arithmetic expression mathematical like '$((1+1))'
. I wish to perform it and deliver its result to a variable.
Example:
$ expression='$((5+5))'
$ echo $expression
'$((5+5))'
$ # Expected result: 10
How can I evaluate that string and store its result?
More From » command-line