From 6b4d5a208500303d4eaec486346f9d64b1fdf92e Mon Sep 17 00:00:00 2001 From: mia Date: Mon, 16 May 2022 11:11:43 -0400 Subject: [PATCH] edits to allow for [ ... ] --- com | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/com b/com index 969f820..3846831 100755 --- a/com +++ b/com @@ -131,7 +131,8 @@ com() { # this allows for recusion for -a/-o handling } } # [ ! ] causes exit code to swap - #echo "$@" + [ ! -z "${n1##*.*}" ] && n1="${n1}.0" + [ ! -z "${n2##*.*}" ] && n2="${n2}.0" case "$op" in '^~'|'~^'|'^='|'-cl') ceil "$n1" "$n2" || hexit 1 ":$@";; '~'|'≈'|'≅'|'-fl') floor "$n1" "$n2" || hexit 1 ":$@";; @@ -147,4 +148,5 @@ com() { # this allows for recusion for -a/-o handling hexit 0 ":$@" # exit 0 if done echo "$? --" } +args="$@"; args="${args##[}"; args="${args%%]}"; set -- $args com "$@"