error reporting

This commit is contained in:
olli 2023-10-06 21:03:15 +02:00
parent 92fd7c66f1
commit 58ac5ccb43

View File

@ -11,7 +11,7 @@ function get_marketdata {
echo ${f_url} | egrep -q "investing.com.+indices" && echo "wget -q -O - ${f_url} | sed 's#</div>#\n#g' | grep 'text-5xl font-bold leading-9 md:text-' | cut -d'>' -f5 | sed 's#,##g'" >MARKET_DATA_CMD
[ -s MARKET_DATA_CMD ] || echo "wget -q -O - ${f_url}" >MARKET_DATA_CMD
g_runcmd g_retrycmd sh MARKET_DATA_CMD >MARKET_DATA_CMD_OUT-${f_name}.tmp
g_runcmd g_retrycmd sh MARKET_DATA_CMD >MARKET_DATA_CMD_OUT-${f_name}.tmp 2>MARKET_DATA_CMD_OUT-${f_name}.tmp.err
# check output
if [ -s MARKET_DATA_CMD_OUT-${f_name}.tmp ] && egrep -q "^[0-9]*\.[0-9]+" MARKET_DATA_CMD_OUT-${f_name}.tmp
@ -24,7 +24,7 @@ function get_marketdata {
mv MARKET_DATA_CMD_OUT-${f_name}.tmp MARKET_DATA_CMD_OUT-${f_name}
fi
else
g_echo_warn "MARKET_DATA_CMD_OUT-${f_name}.tmp has wrong Syntax. - Not updating ${f_name} Index $(tail -n 10 MARKET_DATA_CMD_OUT-${f_name}.tmp)"
g_echo_warn "MARKET_DATA_CMD_OUT-${f_name}.tmp has wrong Syntax. - Not updating ${f_name} Index. Output: \"$(tail -n 10 MARKET_DATA_CMD_OUT-${f_name}.tmp)\"; Error: \"$(tail -n 10 MARKET_DATA_CMD_OUT-${f_name}.tmp.err)\""
fi
if ! [ -e "MARKET_DATA_CMD_OUT-${f_name}" ]
then