Created
May 9, 2020 00:24
-
-
Save StudioEtrange/da223edba28a49076187bcefde5d87fa to your computer and use it in GitHub Desktop.
Bash env manipulation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# launch a shell with an empty env | |
# https://unix.stackexchange.com/a/291913 | |
env -i bash --noprofile --norc | |
# source var file and show a specific var | |
env -i bash --noprofile --norc -c ". somefile.sh; echo $VAR;" | |
# backup/restore env | |
# https://unix.stackexchange.com/questions/284382/export-save-and-import-source-shell-variables | |
declare -p > backup.env | |
. backup.env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment