Can I get rid of eval
here? I\'m trying to set $current_database
with the appropriate variable determined by user input (country and action)
You can use associative arrays, joining the value of both variables. For example:
declare -A databases
# initialization
databases["es:sales"]="blahblah/es/sales.csv"
databases["en:support"]="yadayada/en/support.csv"
Then, you can get the database just by:
echo ${databases["${country}:${action}"]}
This has the advantage of having the database names collected by only one variable.