Follow

Do you like bash as much as I do?

declare -A var_default_values=(
[VAR_UN]="UN"
[VAR_DEUX]="DEUX"
)

for var_name in "${!var_default_values[@]}" ; do
if [[ -z ${!var_name+x} ]] ; then
declare ${var_name}="${var_default_values[$var_name]}"
fi
echo ${!var_name}
done
Β· Β· 0 Β· 0 Β· 0
Sign in to participate in the conversation
Mastodon Opportun.e

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!