diff --git a/shell/env.sh b/shell/env.sh index 4d7dcff7..bc93c45e 100644 --- a/shell/env.sh +++ b/shell/env.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash store_env_vars() { - initial_vars=($(compgen -A variable)) + initial_vars=($(env | cut -d= -f1)) } restore_env_vars() { - for key in $(compgen -A variable); do + for key in $(env | cut -d= -f1); do if ! [[ " ${initial_vars[@]} " =~ " $key " ]]; then unset "$key" fi