4 ms·
Interesting writeup. I loath setting environment variables on long running terminal sessions exactly because it’s not obvious once they’re set. I prefer to use
by jmiserez 9y ago
Interesting writeup. I loath setting environment variables on long running terminal sessions exactly because it’s not obvious once they’re set.
I prefer to use a subshell for the command and set the environment variable each time:
$ ( export FOO=bar; my_cmd )
- ams6110 9y agoOr just: env FOO=bar my_cmd
- cjbprime 9y agoOr just: FOO=bar my_cmd
- mappu 9y agoOr just: FOO=bar my_cmd That's the same but with a leading space, to prevent 'bar' from showing up in your histfile.
- karlding 9y agoOn bash, this assumes that $HISTCONTROL is set to ignoreboth [0]. This is in the default ~/.bashrc on Ubuntu, but I can't speak about other distros. I don't use zsh, but I believe the equivalent is $HIST_IGNORE_SPACE [1]. [0] https://linux.die.net/man/1/bash https://linux.die.net/man/1/bash [1] https://unix.stackexchange.com/questions/6094/is-there-any-way-to-keep-a-command-from-being-added-to-your-history https://unix.stackexchange.com/questions/6094/is-there-any-w...
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]