P. Sravani - 9 months ago 59
Linux Question

# Expression as a string (shell scripting)

I have an expression declared as a string and I want the output to be the result of the expression. I am trying to solve it using shell scripting.
For example

expr="123+456"


expecting output

579


$expr="123+456"$ answer=$(($expr))
$echo$answer