diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-11-04 18:00:41 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-11-04 18:00:41 +1300 |
commit | 866bc83d796c96672a5a10db7951eeac448adb25 (patch) | |
tree | 5eb0307c6d4a799bdc2f7191766facf081d4e3c0 /bash/bashrc.d | |
parent | Forgot to stop using absolute params (diff) | |
download | dotfiles-866bc83d796c96672a5a10db7951eeac448adb25.tar.gz dotfiles-866bc83d796c96672a5a10db7951eeac448adb25.zip |
Today has just not been my day
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r-- | bash/bashrc.d/cd.bash | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash index fa027e52..6644bd1a 100644 --- a/bash/bashrc.d/cd.bash +++ b/bash/bashrc.d/cd.bash @@ -12,16 +12,16 @@ cd() { dirs=("${dirs[@]}" "$arg") fi done - if ((${#dirs} == 2)); then + if ((${#dirs[@]} == 2)); then if [[ $PWD == *"${dirs[0]}"* ]]; then builtin cd "${opts[@]}" \ - "${PWD/${dirs[0]}/${dirs[1]}}" + -- "${PWD/${dirs[0]}/${dirs[1]}}" else printf '%s\n' 'bash: cd: could not replace substring' >&2 return 1 fi else - builtin cd "${opts[@]}" "${dirs[@]}" + builtin cd "${opts[@]}" -- "${dirs[@]}" fi } |