linux - Unbound variable during url printing in bash/shell -
i have 2 variables want use derive 3rd variable:
export region_name=phx export phx_url=https://www.google.com i trying following:
echo "$((${region_name}_url))" and following error:
-sh: https://www.google.com: syntax error in expression (error token "://www.google.com") all trying derive environment variable other 1 not work simple that. think has escaped , not find online.
thanks in advance help.
$((...)) arithmetic expansion. didn't mean that. try normal variable expansion (with indirection) instead.
region_name=phx phx_url=https://www.google.com r_var=${region_name}_url echo "${!r_var}"
Comments
Post a Comment