+# Expand occurrences of `$var' in a given variable
+
+function expand-var
+{
+ eval echo ${!1}
+}
+
+# Given a <prefix>, override each variable <x> by <prefix>_<x>
+
+function override-vars
+{
+ local OR V W
+ declare -a OR
+ # `${!${1}_@}' does not work, so we have to use eval
+ OR=($(eval echo '${!'$1'_@}'))
+ for V in "${OR[@]}" ; do
+ W=${V##$1_}
+ eval $W='"$'$V'"'
+ done
+}
+