aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/cd.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-08-25 03:41:20 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-08-25 03:41:20 +1200
commit9d04cd3c9c4035da7f15e3f9cd96633c59035052 (patch)
tree940b36dd9a83cca68100253a9918aa2f8315a0bb /bash/bashrc.d/cd.bash
parentRearrange prompt declarations so ret is first (diff)
downloaddotfiles-9d04cd3c9c4035da7f15e3f9cd96633c59035052.tar.gz
dotfiles-9d04cd3c9c4035da7f15e3f9cd96633c59035052.zip
Quote rhs of [[ $a == $b ]] to stop globbing
Diffstat (limited to 'bash/bashrc.d/cd.bash')
-rw-r--r--bash/bashrc.d/cd.bash2
1 files changed, 1 insertions, 1 deletions
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash
index a356a4de..0f1eb165 100644
--- a/bash/bashrc.d/cd.bash
+++ b/bash/bashrc.d/cd.bash
@@ -8,7 +8,7 @@ cd() {
done
shift $((OPTIND-1))
if (($# == 2)); then
- if [[ $PWD == *$1* ]]; then
+ if [[ $PWD == *"$1"* ]]; then
builtin cd "${opts[@]}" "${PWD/$1/$2}"
else
printf %s "bash: cd: could not replace substring\n" >&2