aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/keep.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-07-15 00:34:48 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-07-15 00:40:37 +1200
commit8947c4c99f4c1ad92f23e59e84b224cf35e4ff81 (patch)
tree70718ad01791f2ca67133376252cf69a693b14ea /bash/bashrc.d/keep.bash
parent582fd3b69868f12fc14f0fbefb81521445b075fa (diff)
downloaddotfiles-8947c4c99f4c1ad92f23e59e84b224cf35e4ff81.tar.gz
dotfiles-8947c4c99f4c1ad92f23e59e84b224cf35e4ff81.zip
Quote expansions within parameter expansions
I made the incorrect assumption that it was safe not to do this; expansions that include glob characters, for example, can cause problems.
Diffstat (limited to 'bash/bashrc.d/keep.bash')
-rw-r--r--bash/bashrc.d/keep.bash6
1 files changed, 3 insertions, 3 deletions
diff --git a/bash/bashrc.d/keep.bash b/bash/bashrc.d/keep.bash
index c7e42e04..585dd189 100644
--- a/bash/bashrc.d/keep.bash
+++ b/bash/bashrc.d/keep.bash
@@ -29,7 +29,7 @@ keep() {
# Figure out the directory to which we're reading and writing these scripts
local bashkeep
- bashkeep=${BASHKEEP:-$HOME/.bashkeep.d}
+ bashkeep=${BASHKEEP:-"$HOME"/.bashkeep.d}
mkdir -p -- "$bashkeep" || return
# Parse options
@@ -148,8 +148,8 @@ EOF
complete -A function -A variable keep
# Load any existing scripts in bashkeep
-if [[ -d ${BASHKEEP:-$HOME/.bashkeep.d} ]] ; then
- for bashkeep in "${BASHKEEP:-$HOME/.bashkeep.d}"/*.bash ; do
+if [[ -d ${BASHKEEP:-"$HOME"/.bashkeep.d} ]] ; then
+ for bashkeep in "${BASHKEEP:-"$HOME"/.bashkeep.d}"/*.bash ; do
[[ -e $bashkeep ]] || continue
source "$bashkeep"
done