diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-21 21:09:15 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-21 21:25:15 +1200 |
commit | 7ddb8084297c5bf30db73e9b9058d71f52991901 (patch) | |
tree | 8b07077307ae6209d9e094270dbcc65b5e7e80c7 /bash/bashrc.d/keep.bash | |
parent | Restructure ed() to test,cache features on login (diff) | |
download | dotfiles-7ddb8084297c5bf30db73e9b9058d71f52991901.tar.gz dotfiles-7ddb8084297c5bf30db73e9b9058d71f52991901.zip |
Many stylistic fixes/optimisations
In particular, limit the verbose >=2.05 test to just one file: .bashrc
Diffstat (limited to 'bash/bashrc.d/keep.bash')
-rw-r--r-- | bash/bashrc.d/keep.bash | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/bash/bashrc.d/keep.bash b/bash/bashrc.d/keep.bash index b1c8bea4..fb4b8bde 100644 --- a/bash/bashrc.d/keep.bash +++ b/bash/bashrc.d/keep.bash @@ -45,9 +45,7 @@ keep() { # -h given; means show help h) - while IFS= read -r line ; do - printf '%s\n' "$line" - done <<EOF + cat <<EOF $FUNCNAME: Keep variables and functions in shell permanently by writing them to named scripts iterated on shell start, in \$BASHKEEP (defaults to ~/.bashkeep.d). @@ -145,10 +143,7 @@ EOF } # Load any existing scripts in bashkeep -if [[ -d ${BASHKEEP:-"$HOME"/.bashkeep.d} ]] ; then - for bashkeep in "${BASHKEEP:-"$HOME"/.bashkeep.d}"/*.bash ; do - [[ -e $bashkeep ]] || continue - source "$bashkeep" - done - unset -v bashkeep -fi +for bashkeep in "${BASHKEEP:-"$HOME"/.bashkeep.d}"/*.bash ; do + [[ -e $bashkeep ]] && source "$bashkeep" +done +unset -v bashkeep |