When I try to calculate a maths problem such as 1 + 1 using the Ubuntu console like this:
user@servername:~$ 1 + 1
Ubuntu thinks the first 1
is a command and I get this error:
1: command not found
I then tried to use echo to evaluate the string (with and without quotes) like this:
user@servername:~$ echo 1 + 1
user@servername:~$ echo "1 + 1"
Unfortunatly both output 1 + 1
and not 2
.
It would also be greatly appreciated to include a explanation as to why echo
does not evaluate the specified string before outputting it?
Also is there is a built-in command that evaluates a string before outputting it (maybe something that behaves like eval in Python)?
Thank you for the help in advance.