I was wondering, is it possible to do simple maths in bash? I'm thinking something like, =25-5 would print out 20 or something.
Can this be done easily?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Well your question is answered, but consider this:
Most of the linux distros have python preinstalled, so why not use it?
in the terminal and then do all the arithmetic you want, like
Will output 4 :)
You can also do this directly from terminal with the
-c python argument.
python -c 'print 2+2'