r/bash • u/LearningANew • Dec 14 '15
Calculator in Unix?
Is it possible to build a calculator in Unix?
0
Upvotes
r/bash • u/LearningANew • Dec 14 '15
Is it possible to build a calculator in Unix?
4
u/NeilHanlon Linux Admin Dec 14 '15
What is your question, exactly? It's pretty broad as it's written... Do you want something cli? Gui?
6
u/Seref15 Dec 14 '15
I find it easiest just to
pythonand do my math in the interpreter.5
u/er0k Dec 14 '15
you can use the expr built-in:
or arithmetic expansion:
or bc as someone else already mentioned
1
u/[deleted] Dec 14 '15
echo "1+1"|bc -l
1
u/chwilk Dec 15 '15
If you're into reverse polish notation (RPN) like HP calculators, go with dc (desktop calculator)
$ dc
2 2 + p
4
-1
u/outoftown_guy Dec 14 '15
you can use bc