aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-02 22:16:25 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-02 22:16:25 +1300
commit8d2670642c6de689948257bcdd7097e53ced83cb (patch)
tree6acd947d1e65ee78c46bbd954727594856953b75 /bash
parentc8a6cba61697c02ecc2e3c5db27629630d9fade2 (diff)
downloaddotfiles-8d2670642c6de689948257bcdd7097e53ced83cb.tar.gz
dotfiles-8d2670642c6de689948257bcdd7097e53ced83cb.zip
Use simple loop rather than glob tricks in keep
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc.d/keep.bash12
1 files changed, 6 insertions, 6 deletions
diff --git a/bash/bashrc.d/keep.bash b/bash/bashrc.d/keep.bash
index 2eebdae3..48196aeb 100644
--- a/bash/bashrc.d/keep.bash
+++ b/bash/bashrc.d/keep.bash
@@ -130,12 +130,12 @@ EOF
# Otherwise the user must want us to print all the NAMEs kept
(
shopt -s nullglob
- declare -a keeps
- keeps=("$bashkeep"/*.bash)
- keeps=("${keeps[@]##*/}")
- keeps=("${keeps[@]%.bash}")
- ((${#keeps[@]})) || exit 0
- printf '%s\n' "${keeps[@]}"
+ for keep in "$bashkeep"/*.bash ; do
+ ! [[ -d $keep ]] || continue
+ keep=${keep##*/}
+ keep=${keep%.bash}
+ printf '%s\n' "$keep"
+ done
)
}