more pure bash to speed up things

This commit is contained in:
olli 2023-11-12 14:47:56 +01:00
parent f0ffbc248e
commit 57eb99789a

View File

@ -74,10 +74,12 @@ function analyze {
f_buy_score="" f_buy_score=""
time=$(echo $line | cut -d, -f1 | cut -d: -f1,2) time=$(echo $line | cut -d, -f1 | cut -d: -f1,2)
f_market_performance_before=${f_market_performance}
#f_market_performance=$(grep "^$time" data/botdata/MARKET_PERFORMANCE | tail -n1 | cut -d: -f4 | cut -d"%" -f1 | sed 's/ *//') #f_market_performance=$(grep "^$time" data/botdata/MARKET_PERFORMANCE | tail -n1 | cut -d: -f4 | cut -d"%" -f1 | sed 's/ *//')
time=${time//[^0-9]/} time=${time//[^0-9]/}
f_market_performance=${f_market_performace_array[${time}]} f_market_performance=${f_market_performace_array[${time}]}
echo "MARKET_PERF=$f_market_performance" echo "MARKET_PERF=$f_market_performance"
[ -z "${f_market_performance}" ] && f_market_performance=${f_market_performance_before}
echo "$line" >>${g_tmp}/${tmpfile} echo "$line" >>${g_tmp}/${tmpfile}
#echo " ${line},${f_market_performance}" | perl -pe 's/([0-9].[0-9][0-9][0-9][0-9][0-9][0-9])[0-9]+/$1/g' | column -t -s, >>${g_tmp}/output-${tmpfile} #echo " ${line},${f_market_performance}" | perl -pe 's/([0-9].[0-9][0-9][0-9][0-9][0-9][0-9])[0-9]+/$1/g' | column -t -s, >>${g_tmp}/output-${tmpfile}