diff options
author | johannst <stoelp@eit.uni-kl.de> | 2018-04-06 16:45:15 +0900 |
---|---|---|
committer | johannst <stoelp@eit.uni-kl.de> | 2018-04-06 16:45:15 +0900 |
commit | 73a55130911dcde9d43ceb3be713d88fe50f8769 (patch) | |
tree | bd94936682ab4caa038053b3dc4e04a5f142d36f | |
parent | e8be0f72346477aa267ed59db02d6b7aa031f8dc (diff) | |
download | dotfiles-73a55130911dcde9d43ceb3be713d88fe50f8769.tar.gz dotfiles-73a55130911dcde9d43ceb3be713d88fe50f8769.zip |
bashrc added save/restore functions
-rw-r--r-- | bashrc | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -166,3 +166,28 @@ function perr() { } #}}} +#{{{ save/restore settings + +function save_bash_options() { + local backup_file=$1 + set +o >> $backup_file +} + +function save_bash_exports() { + local backup_file=$1 + export -p >> $backup_file +} + +function save_bash() { + local backup=${1:-~/.saved_bash_env} + :> $backup + save_bash_options $backup + save_bash_exports $backup +} + +function restore_bash() { + local backup=${1:-~/.saved_bash_env} + source $backup +} + +#}}} |