bin(calc): support multiple expression inputs
This commit is contained in:
parent
173ae2884b
commit
5793071836
1 changed files with 6 additions and 4 deletions
|
@ -1,6 +1,8 @@
|
|||
#!/bin/zsh
|
||||
# Note: this is compatible with `sh`, but because
|
||||
# `sh` does not handle floats, I'm choosing `zsh`.
|
||||
# Basic calculator using the shell
|
||||
# Note that zsh can handle floating-point math, whereas POSIX sh cannot
|
||||
|
||||
# Believe it or not, zsh makes for a fine calculator
|
||||
echo $(($*))
|
||||
for v; do
|
||||
printf ' %s ' "$(($v))"
|
||||
done
|
||||
echo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue