Revision 13116
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/lib/sh/util.sh | ||
---|---|---|
75 | 75 |
|
76 | 76 |
#### vars |
77 | 77 |
|
78 |
alias local_array='declare' |
|
79 |
# `local` does not support arrays in older versions of bash |
|
80 |
# don't need -a because that it's an array is autodetected by the () |
|
78 |
alias local_array='declare -a' |
|
79 |
# `local` does not support arrays in older versions of bash/on Mac |
|
81 | 80 |
|
82 | 81 |
set_var() { eval "$1"'="$2"'; } |
83 | 82 |
|
... | ... | |
94 | 93 |
|
95 | 94 |
alias local_export='declare -x' # combines effects of local and export |
96 | 95 |
|
97 |
alias export_array='declare -x' |
|
98 |
# `export` does not support arrays in older versions of bash |
|
99 |
# don't need -a because that it's an array is autodetected by the () |
|
96 |
alias export_array='declare -ax' |
|
97 |
# `export` does not support arrays in older versions of bash/on Mac |
|
100 | 98 |
|
101 | 99 |
# to make export only visible locally: local var="$var"; export var |
102 | 100 |
# within cmd: var="$var" cmd... |
Also available in: Unified diff
bugfix: lib/sh/util.sh: local_array/export_array: do need -a because that it's an array is apparently not autodetected by the () on Mac