diff --git a/dabo/functions/get_values.sh b/dabo/functions/get_values.sh index 2d65994..be2ea6a 100644 --- a/dabo/functions/get_values.sh +++ b/dabo/functions/get_values.sh @@ -69,13 +69,14 @@ function get_values { if [ -s "$f_levelsfile" ] then # get levels - g_array "$f_levelsfile" f_levels " " + read -r -a f_levels <"$f_levelsfile" v[${f_asset}_levels_$f_time]="${f_levels[*]}" # add current price and sort f_levels+=("${v[${f_asset}_price]}") + oldIFS="$IFS" IFS=$'\n' f_levels_sorted=($(sort -n <<<"${f_levels[*]}")) - unset IFS + IFS="$oldIFS" # find current price and +- one for upper lower price for ((i=0; i<${#f_levels_sorted[@]}; i++)); do