From 579307183679d6a84788114e46d5d7067b701f92 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Fri, 6 Jun 2025 00:00:31 -0700 Subject: [PATCH] bin(calc): support multiple expression inputs --- .config/shell/bin/calc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.config/shell/bin/calc b/.config/shell/bin/calc index 6306c4a..7882ba5 100755 --- a/.config/shell/bin/calc +++ b/.config/shell/bin/calc @@ -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