mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
16 lines
251 B
Bash
16 lines
251 B
Bash
#!/usr/bin/env bash
|
|
|
|
store_env_vars() {
|
|
initial_vars=($(compgen -A variable))
|
|
}
|
|
|
|
restore_env_vars() {
|
|
for key in $(compgen -A variable); do
|
|
if ! [[ " ${initial_vars[@]} " =~ " $key " ]]; then
|
|
unset "$key"
|
|
fi
|
|
done
|
|
}
|
|
|
|
store_env_vars
|