fix empty vars

This commit is contained in:
olli 2023-11-27 22:48:51 +01:00
parent aac84b963d
commit d082739a49
2 changed files with 3 additions and 4 deletions

View File

@ -83,8 +83,6 @@ function analyze {
[ -z "${f_last_lines_array[3]}" ] && continue [ -z "${f_last_lines_array[3]}" ] && continue
echo "$line" >>${g_tmp}/${tmpfile} echo "$line" >>${g_tmp}/${tmpfile}
# get vars
get_vars_from_csv ${g_tmp}/${tmpfile} || continue
# get time from market_performance # get time from market_performance
local f_time="${f_date%:*}" local f_time="${f_date%:*}"
@ -96,6 +94,9 @@ function analyze {
f_market_performance_before=${f_market_performance} f_market_performance_before=${f_market_performance}
#echo "MARKET_PERF=$f_market_performance" #echo "MARKET_PERF=$f_market_performance"
# get vars
get_vars_from_csv ${g_tmp}/${tmpfile} || continue
#if [ -f "${g_tmp}/open-${tmpfile}" ] #if [ -f "${g_tmp}/open-${tmpfile}" ]
if [ -n "${f_open_trade}" ] if [ -n "${f_open_trade}" ]
then then

View File

@ -8,13 +8,11 @@ function get_vars_from_csv {
return 1 return 1
fi fi
set -x
if [ -z "${f_market_performance}" ] if [ -z "${f_market_performance}" ]
then then
f_market_performance="0" f_market_performance="0"
fi fi
f_all_vars="f_market_performance=${f_market_performance}" f_all_vars="f_market_performance=${f_market_performance}"
set +x
# read last 4 lines in array if not given # read last 4 lines in array if not given
if [ -z "${f_last_lines_array}" ] if [ -z "${f_last_lines_array}" ]