X-Git-Url: https://git.madduck.net/etc/zsh.git/blobdiff_plain/33230b65afa1076218abff057d0bbcc7486af0a8..59aba6c965455891a22e8ea22f561854e43903bd:/.zsh/util diff --git a/.zsh/util b/.zsh/util index d3292f4..422dba9 100644 --- a/.zsh/util +++ b/.zsh/util @@ -16,7 +16,7 @@ array_prepend() { local arrayname="$1"; shift local i for i; do - eval "$arrayname=(\$i \${$arrayname[@]/\$i})" + eval "typeset -ga $arrayname; $arrayname=(\$i \${$arrayname[@]/\$i})" done } @@ -24,7 +24,7 @@ array_append() { local arrayname="$1"; shift local i for i; do - eval "$arrayname=(\${$arrayname[@]/\$i} \$i)" + eval "typeset -ga $arrayname; $arrayname=(\${$arrayname[@]/\$i} \$i)" done }