diff --git a/gaboshlib/g_calc.sh b/gaboshlib/g_calc.sh index a8775fe..1862160 100644 --- a/gaboshlib/g_calc.sh +++ b/gaboshlib/g_calc.sh @@ -25,12 +25,19 @@ function g_calc { # do bc echo "scale=8; $@" >&3 local g_bc_out - read g_bc_out <&4 + if ! read -t 0 g_bc_out <&4 + then + g_traceback + return 1 + fi # do sed echo ${g_bc_out} >&5 local g_sed_out - read g_sed_out <&6 + if ! read -t 0 g_sed_out <&6 + g_traceback + return 1 + fi # echo result echo ${g_sed_out}