From 93bb06589977b08a213c5516a8db295f6f8e8e62 Mon Sep 17 00:00:00 2001 From: olli Date: Sun, 26 Nov 2023 16:24:30 +0100 Subject: [PATCH] fix g_calc with result-var --- gaboshlib/g_calc.sh | 4 +++- gaboshlib/g_num_is_lower.sh | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gaboshlib/g_calc.sh b/gaboshlib/g_calc.sh index 748330a..842aa81 100644 --- a/gaboshlib/g_calc.sh +++ b/gaboshlib/g_calc.sh @@ -1,5 +1,7 @@ function g_calc { + unset g_calc_result + # Use bc in backround for multiple bc's running much faster if [ -z "${g_bc_running}" ] then @@ -49,6 +51,6 @@ function g_calc { return 1 fi - # echo result + # store result g_calc_result="${g_sed_out}" } diff --git a/gaboshlib/g_num_is_lower.sh b/gaboshlib/g_num_is_lower.sh index 00df3f4..46f3ed3 100644 --- a/gaboshlib/g_num_is_lower.sh +++ b/gaboshlib/g_num_is_lower.sh @@ -48,6 +48,7 @@ function g_num_is_lower { # Check for valid number g_num_valid_number "$f_num" "$f_checkhigher" || return 1 + g_calc "${f_num} < ${f_checkhigher}" if [ ${g_calc_result} -ne 0 ] then return 0