aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/cd.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-08-05 23:51:49 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-08-05 23:51:49 +1200
commitcb991f86aa13ef5e062efd6f76b51af1bd5fe474 (patch)
treeec8bafa8d4984cc4764ef8cb44b00e54997aaac3 /bash/bashrc.d/cd.bash
parentSort options alphabetically (diff)
downloaddotfiles-cb991f86aa13ef5e062efd6f76b51af1bd5fe474.tar.gz
dotfiles-cb991f86aa13ef5e062efd6f76b51af1bd5fe474.zip
Quote expansions in cd function
Diffstat (limited to 'bash/bashrc.d/cd.bash')
-rw-r--r--bash/bashrc.d/cd.bash4
1 files changed, 2 insertions, 2 deletions
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash
index b03bdaac..0b4944ba 100644
--- a/bash/bashrc.d/cd.bash
+++ b/bash/bashrc.d/cd.bash
@@ -5,8 +5,8 @@ __cd() {
while getopts elP opt; do
opts="$opts -$opt"
done
- shift $(($OPTIND-1))
- if [[ $# -eq 2 ]]; then
+ shift "$(($OPTIND-1))"
+ if [[ "$#" -eq 2 ]]; then
builtin cd $opts "${PWD/$1/$2}"
else
builtin cd $opts "$@"