From 861e2b940282cad59198ba4c642862728207f190 Mon Sep 17 00:00:00 2001 From: olli Date: Sat, 11 Nov 2023 17:16:17 +0100 Subject: [PATCH] more pure bash to speed up things --- dabo/functions/get_vars_from_csv.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dabo/functions/get_vars_from_csv.sh b/dabo/functions/get_vars_from_csv.sh index e85c49c..2215843 100644 --- a/dabo/functions/get_vars_from_csv.sh +++ b/dabo/functions/get_vars_from_csv.sh @@ -12,6 +12,8 @@ function get_vars_from_csv { mapfile -t f_last_lines <<< $(tail -n4 "${f_ASSET_HIST_FILE}") fi +set -x + if [ -z "${f_market_performance}" ] then f_market_performance="-50" @@ -20,12 +22,13 @@ function get_vars_from_csv { #f_last_line="$(tail -n1 "${f_ASSET_HIST_FILE}"),${f_market_performance}" f_last_line="${f_last_lines[3]}" - echo "f_last_line: ${f_last_line}" 1>&2 readarray -d "," -t f_last_line_array < <(echo "0,${f_last_line}") readarray -d "," -t f_2_last_line_array < <(echo "0,${f_last_lines[2]}") readarray -d "," -t f_3_last_line_array < <(echo "0,${f_last_lines[1]}") readarray -d "," -t f_4_last_line_array < <(echo "0,${f_last_lines[0]}") +set +x + f_asset=$(basename ${f_ASSET_HIST_FILE} | cut -d\. -f1) # basics