diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-11-08 14:38:09 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-11-08 14:38:09 -0500 |
commit | 4b418ee4900156ad98b316f31b7731d11837b164 (patch) | |
tree | 177e865439248f116503b5a9027887f4c1ec2bc4 /.local/bin/config-path | |
parent | 73792d5157d709ebe3d5ff35563692ac04e89fbd (diff) | |
parent | 3477cafcc1ecf1cefd2c36a7fac36c86443ea573 (diff) |
Merge branch 'master' into gluglugt60-par/master
Diffstat (limited to '.local/bin/config-path')
-rwxr-xr-x | .local/bin/config-path | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/.local/bin/config-path b/.local/bin/config-path index cbecc95..eb88092 100755 --- a/.local/bin/config-path +++ b/.local/bin/config-path @@ -40,15 +40,14 @@ var_add() { } var_done() { - eval "$1=\"\${ary_$1[*]}\"" - declare -p $1 + local var=$1 + local valref="ary_${var}[*]" + printf '%s=%q\n' "${var}" "${!valref}" } main() { - export LC_ALL=C # Work around brokenly slow Unicode handling - # in Bash - IFS=: + # Import existing values var_init PATH var_init LD_LIBRARY_PATH @@ -66,12 +65,9 @@ main() { done # Finally, print the values - lines=() for var in PATH LD_LIBRARY_PATH PKG_CONFIG_PATH RUBYLIB PERL5LIB; do - lines+=("$(var_done "$var")") + var_done "$var" done - shopt -s extglob - printf -- '%s\n' "${lines[@]##declare *(-+([[:graph:]]) )}" } main "$@" |