|We don't bite newbies here... much|
Re: Simple CLI calculator based on Perl's eval()by kcott (Archbishop)
|on Mar 04, 2021 at 04:27 UTC||Need Help??|
"Sometimes I need to do a quick calculation. I'm too lazy to open a GUI calculator ..."
Me, too. I have a file, .bash_functions, that I source from .bashrc, which contains this function:
Here's some examples. The first two show normal operation; the third shows error handling.
Obviously, that has less functionality than ++yours; however, it has served me well for quick calculations on the command line.
In anticipation of the question, "What does the 's' stand for?"; the answer is, "I don't remember". I've been using that function for probably a decade or more; the meaning of 's' has been lost in the mists of time. :-)