From 1e7b7ec8d9dbd1df677ff261ebb8a70bab41a52a Mon Sep 17 00:00:00 2001 From: olli Date: Sat, 11 Nov 2023 18:04:25 +0100 Subject: [PATCH] more pure bash to speed up things --- dabo/functions/get_vars_from_csv.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dabo/functions/get_vars_from_csv.sh b/dabo/functions/get_vars_from_csv.sh index a8c5363..ba02f69 100644 --- a/dabo/functions/get_vars_from_csv.sh +++ b/dabo/functions/get_vars_from_csv.sh @@ -12,19 +12,17 @@ function get_vars_from_csv { f_market_performance="-50" fi f_all_vars="f_market_performance=${f_market_performance}" - + + set -x # 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}") fi - - set -x # if there are not four lines [ -z "${f_last_lines_array[3]}" ] && return 1 - # create array of last line fields #f_last_line="$(tail -n1 "${f_ASSET_HIST_FILE}"),${f_market_performance}" f_last_line="${f_last_lines_array[3]},${f_market_performance}"