sort multiple matches
This commit is contained in:
parent
16bb308c4b
commit
f36485f1eb
@ -101,10 +101,12 @@ function currency_converter {
|
|||||||
do
|
do
|
||||||
# search for most precise date
|
# search for most precise date
|
||||||
f_line=$(egrep "^$f_currency_date_minute" "$f_histfile"*m.csv 2>/dev/null | tail -n1)
|
f_line=$(egrep "^$f_currency_date_minute" "$f_histfile"*m.csv 2>/dev/null | tail -n1)
|
||||||
[ -z "$f_line" ] && f_line=$(egrep "^$f_currency_date_hour" "$f_histfile"*m.csv 2>/dev/null | tail -n1)
|
set -x
|
||||||
[ -z "$f_line" ] && f_line=$(egrep "^$f_currency_date_day" "$f_histfile"*h.csv 2>/dev/null | tail -n1)
|
[ -z "$f_line" ] && f_line=$(egrep "^$f_currency_date_hour" "$f_histfile"*m.csv 2>/dev/null | sort | tail -n1)
|
||||||
[ -z "$f_line" ] && f_line=$(egrep "^$f_currency_date_month" "$f_histfile"*.csv 2>/dev/null | tail -n1)
|
[ -z "$f_line" ] && f_line=$(egrep "^$f_currency_date_day" "$f_histfile"*h.csv 2>/dev/null | sort | tail -n1)
|
||||||
|
[ -z "$f_line" ] && f_line=$(egrep "^$f_currency_date_month" "$f_histfile"*.csv 2>/dev/null | sort | tail -n1)
|
||||||
[ -n "$f_line" ] && f_rate=$(echo "$f_line" | cut -d, -f2)
|
[ -n "$f_line" ] && f_rate=$(echo "$f_line" | cut -d, -f2)
|
||||||
|
set +x
|
||||||
f_reverse=false
|
f_reverse=false
|
||||||
if [ -n "$f_rate" ]
|
if [ -n "$f_rate" ]
|
||||||
then
|
then
|
||||||
|
Loading…
Reference in New Issue
Block a user