edits to allow for [ ... ]

This commit is contained in:
Mia T. Rain 2022-05-16 11:11:43 -04:00
parent cc0d5d97a9
commit 6b4d5a2085
Signed by: Mia
GPG Key ID: 5F40D66F94DECFE8
1 changed files with 3 additions and 1 deletions

4
com
View File

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