diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-05 23:51:49 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-05 23:51:49 +1200 |
commit | cb991f86aa13ef5e062efd6f76b51af1bd5fe474 (patch) | |
tree | ec8bafa8d4984cc4764ef8cb44b00e54997aaac3 /bash/bashrc.d/cd.bash | |
parent | Sort options alphabetically (diff) | |
download | dotfiles-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.bash | 4 |
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 "$@" |