credsfile="private/os/$1.yml" while read line; do if [[ "$line" =~ ^([a-zA-Z0-9_]*):\ ?(.*)$ ]]; then key="${BASH_REMATCH[1]}" if test "$key" = os_nova_password; then key=os_password fi eval set ${BASH_REMATCH[2]} eval export "${key^^}"="\"$@\"" fi done < "$credsfile" # vi: syntax=sh