From 64915aeb782ae3369ae9043b98e82c07f8a6013e Mon Sep 17 00:00:00 2001 From: Blau Araujo Date: Mon, 14 Mar 2022 14:04:07 -0300 Subject: [PATCH] now, results go to history! --- cawk | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cawk b/cawk index 0561232..d55a817 100755 --- a/cawk +++ b/cawk @@ -81,10 +81,16 @@ repl() { read -erp ': ' history -s "$REPLY" case "${REPLY,,}" in - f*( )+([0-9])) PRECISION=${REPLY:1};; - h|'?') echo "$help" ;; - q|quit) die 0 ;; - *) calc "$REPLY" $PRECISION ;; + f*( )+([0-9])) PRECISION=${REPLY:1} + ;; + h|'?') echo "$help" + ;; + q|quit) die 0 + ;; + *) local r=$(calc "$REPLY" $PRECISION) + echo "$r" + history -s "$r" + ;; esac done }