fix
This commit is contained in:
parent
c0fe474c19
commit
398daf619f
@ -7,9 +7,9 @@ function currency_converter {
|
||||
local f_currency_target=$3
|
||||
local f_currency_date=$4
|
||||
|
||||
unset f_currency_converter_result
|
||||
local f_reverse=false
|
||||
local f_line f_rate f_histfile f_date_array f_stablecoin
|
||||
unset f_currency_converter_result
|
||||
|
||||
local f_line f_rate f_histfile f_date_array f_stablecoin f_reverse
|
||||
|
||||
# get current date if none given
|
||||
[ -z "$f_currency_date" ] && printf -v f_currency_date '%(%Y-%m-%d %H:%M:%S)T'
|
||||
@ -83,6 +83,7 @@ function currency_converter {
|
||||
[ -z "$f_line" ] && f_line=$(egrep "^$f_currency_date_day" "$f_histfile" | tail -n1)
|
||||
[ -z "$f_line" ] && f_line=$(egrep "^$f_currency_date_month" "$f_histfile" | tail -n1)
|
||||
[ -n "$f_line" ] && f_rate=$(echo "$f_line" | cut -d, -f2)
|
||||
f_reverse=false
|
||||
if [ -n "$f_rate" ]
|
||||
then
|
||||
[[ $f_histfile =~ ${f_currency}${f_currency_target} ]] && f_reverse=true
|
||||
|
Loading…
Reference in New Issue
Block a user