ok if i write 1+1 in prompz i get error message....is possible to use "calculator" in bash (like in python shell)
Printable View
ok if i write 1+1 in prompz i get error message....is possible to use "calculator" in bash (like in python shell)
expr 1 + 1
bash does not have builtin math functions like python or perl
You could potentially use a sort of built-in Bash utility:
$[...] syntax means "do the math in here", and the echo prints out the result.Code:echo $[1 + 1]
Also, you can install commandline calculators. I personally am fond of Qalculate!: there is a CLI version that you get when you install the GUI version.
anyway i dont have to make any calculations (i was just curious);
thanks