bin(calc): support multiple expression inputs

This commit is contained in:
PowerUser64 2025-06-06 00:00:31 -07:00
parent 173ae2884b
commit 5793071836

View file

@ -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