Timeline for Unset an environment variable for one command
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 29, 2017 at 0:37 | comment | added | Peter Cordes |
+1 because this way is simple to type for interactive use. I use subshells for one-off changes to the shell environment for a one-liner instead of remembering that it's env -u.
|
|
| Aug 28, 2017 at 19:05 | history | edited | Stephen Kitt | CC BY-SA 3.0 |
Use exec (thanks Charles).
|
| Aug 28, 2017 at 19:01 | comment | added | Stephen Kitt |
@Charles indeed, although some shells do that automatically since command is the last command in the subshell invocation.
|
|
| Aug 28, 2017 at 17:12 | comment | added | Charles Duffy |
(unset ENV_VAR; exec somecommand) if you want to be equivalent to the original in efficiency (by consuming the subshell). As it is, this adds an extra fork.
|
|
| Aug 28, 2017 at 14:33 | history | answered | Stephen Kitt | CC BY-SA 3.0 |