diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-07-09 01:02:47 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2021-07-09 01:18:44 +0200 |
commit | 5f6375a816803d17c8ec0f7c2ef960c848be6166 (patch) | |
tree | b601d8b7a7d6e318336f2b34308b5dd8bade1974 /src/nix/get-env.sh | |
parent | b1f1347ade81d1f04f2d490baceefb3c4de0b4e3 (diff) |
nix develop: Filter some bash magic variables
Diffstat (limited to 'src/nix/get-env.sh')
-rw-r--r-- | src/nix/get-env.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nix/get-env.sh b/src/nix/get-env.sh index 834b84e35..20937b956 100644 --- a/src/nix/get-env.sh +++ b/src/nix/get-env.sh @@ -42,6 +42,20 @@ __dumpEnv() { local type="${BASH_REMATCH[1]}" local __var_name="${BASH_REMATCH[2]}" + if [[ $__var_name =~ ^BASH_ || \ + $__var_name = _ || \ + $__var_name = DIRSTACK || \ + $__var_name = EUID || \ + $__var_name = FUNCNAME || \ + $__var_name = HISTCMD || \ + $__var_name = HOSTNAME || \ + $__var_name = PIPESTATUS || \ + $__var_name = PWD || \ + $__var_name = RANDOM || \ + $__var_name = SHLVL || \ + $__var_name = SECONDS \ + ]]; then continue; fi + if [[ -z $__first ]]; then printf ',\n'; else __first=; fi printf " " |