From 866bc83d796c96672a5a10db7951eeac448adb25 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 4 Nov 2013 18:00:41 +1300 Subject: Today has just not been my day --- bash/bashrc.d/cd.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bash') 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 } -- cgit v1.2.3