From 4ad3e475f8b27f4fd62a051df6017f7d3d850c32 Mon Sep 17 00:00:00 2001 From: olli Date: Mon, 6 Nov 2023 22:00:08 +0100 Subject: [PATCH] ifs fix --- dabo/analyze.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dabo/analyze.sh b/dabo/analyze.sh index 1eb39ed..3a9d252 100755 --- a/dabo/analyze.sh +++ b/dabo/analyze.sh @@ -47,20 +47,23 @@ function analyze { rm -f ${g_tmp}/interim-${tmpfile} rm -f ${g_tmp}/output-${tmpfile} - local f_ORIGIFS="$IFS" - IFS=$'\n' + #local f_ORIGIFS="$IFS" + #IFS=$'\n' # Chart Part echo "$(head -n1 ${file}),Market Perrormance,Score,Buy Score,Sell Score,InTrade,Inetrim Result" >analyze-${analyzedate}/chart-${tmpfile} # Chart Part End - for line in $(egrep "^${ANALYZE_TIME}" "$file" | grep -v ',,,') + #for line in $(egrep "^${ANALYZE_TIME}" "$file" | grep -v ',,,') + local f_lines + mapfile -t f_lines <<<$(egrep "^${ANALYZE_TIME}" "$file" | grep -v ',,,') + for line in "${f_lines[@]}" do # Chart Part f_sell_score="" f_buy_score="" # Chart Part End - IFS=$f_ORIGIFS + #IFS=$f_ORIGIFS current=$(echo $line | cut -d, -f2) time=$(echo $line | cut -d, -f1 | cut -d: -f1,2) f_market_performance=$(grep "^$time" data/botdata/MARKET_PERFORMANCE | tail -n1 | cut -d: -f4 | cut -d"%" -f1 | sed 's/ *//')