From e7bfb84790373452a74e03695edfe1e338c2c999 Mon Sep 17 00:00:00 2001 From: olli Date: Sat, 11 Nov 2023 18:01:44 +0100 Subject: [PATCH] more pure bash to speed up things --- dabo/functions/get_vars_from_csv.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dabo/functions/get_vars_from_csv.sh b/dabo/functions/get_vars_from_csv.sh index d7dc9bf..303b1e3 100644 --- a/dabo/functions/get_vars_from_csv.sh +++ b/dabo/functions/get_vars_from_csv.sh @@ -13,8 +13,7 @@ function get_vars_from_csv { fi f_all_vars="f_market_performance=${f_market_performance}" - - # read last 4 lines in array if not given +G # read last 4 lines in array if not given if [ -z "${f_last_lines_array}" ] then mapfile -t f_last_lines_array <<< $(tail -n4 "${f_ASSET_HIST_FILE}") @@ -82,6 +81,8 @@ f_price_trend=${f_price_trend}" get_var_from_line ema12 4 get_var_from_line ema26 5 + + set -x # MACD get_var_from_line macd_histogram 8 get_var_from_line macd_signal_relation 9 @@ -91,6 +92,7 @@ f_price_trend=${f_price_trend}" f_all_vars="${f_all_vars} f_macd_histogram_relation=${f_macd_histogram_relation} f_macd_histogram_signal=${f_macd_histogram_signal}" + set +x # rsi get_var_from_line rsi5 10 @@ -134,12 +136,11 @@ f_macd_histogram_signal=${f_macd_histogram_signal}" # Coingecko price get_var_from_line coingecko_price 40a -set | grep f_ + +set | grep f_ 1>&2 } -set | grep f_ - function get_var_from_line { if [ -z "${f_last_line_array[$2]}" ] then