Project

General

Profile

« Previous | Next » 

Revision 9093

lib/sh/util.sh: import_vars alias and applicable aliases that use it: documented that when used inside another alias 2+ levels deep, it must be run inside a function. this is due to a strange bug in bash where $() expressions in 2-level aliases produce a syntax error when the alias is expanded outside a function.

View differences:

util.sh
264 264
get_prefix_vars() { : "${prefix:?}"; eval echo '${!'$prefix'*}'; }
265 265

  
266 266
# usage: local prefix=..._; import_vars
267
# when used inside another alias 2+ levels deep, *must* be run inside a function
267 268
alias import_vars="$(cat <<'EOF'
268 269
: "${prefix:?}"
269 270
declare src_var dest_var

Also available in: Unified diff