3 ms·
A little syntactic sugar (in zsh): function calc { print $1 | bc -l } Then: calc "(1+2)*3" 9 zsh actually comes with its own little calculator:
by gnosis 13y ago
A little syntactic sugar (in zsh):
function calc {
print $1 | bc -l
}
Then:
calc "(1+2)*3"
9
zsh actually comes with its own little calculator:
zcalc "(1+2)*3"
1> 9
2>
Among other things, it features "full command line editing, including the history of previous calculations".