From 2bddc692475dd4f6ba171c2e944998eca53e8d58 Mon Sep 17 00:00:00 2001 From: olli Date: Sun, 12 Nov 2023 17:50:55 +0100 Subject: [PATCH] more pure bash to speed up things --- dabo/analyze.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dabo/analyze.sh b/dabo/analyze.sh index 93165c7..7f811a4 100755 --- a/dabo/analyze.sh +++ b/dabo/analyze.sh @@ -50,9 +50,6 @@ function analyze { rm -rf ${g_tmp}/interim-${tmpfile} rm -rf ${g_tmp}/output-${tmpfile} - #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 @@ -78,12 +75,12 @@ function analyze { local f_time="${f_date%:*}" f_time="${f_time//[^0-9]/}" - echo "$f_time -" - time=$(echo $line | cut -d, -f1 | cut -d: -f1,2) + echo "$f_time" + + #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/ *//') - time=${time//[^0-9]/} - f_market_performance=${f_market_performace_array[${time}]} + #time=${time//[^0-9]/} + f_market_performance=${f_market_performace_array[${f_time}]} [ -z "${f_market_performance}" ] && f_market_performance=${f_market_performance_before} f_market_performance_before=${f_market_performance} echo "MARKET_PERF=$f_market_performance"