From 79309afa6f6d8b4f3a607694608b499db6b992fa Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 10 Feb 2014 23:54:25 +1300 Subject: Use space before semicolon as command separator --- bash/bashrc.d/cd.bash | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bash/bashrc.d/cd.bash') diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash index 6644bd1a..26cffae0 100644 --- a/bash/bashrc.d/cd.bash +++ b/bash/bashrc.d/cd.bash @@ -3,17 +3,17 @@ cd() { local arg dir endopts local -a opts dirs - for arg in "$@"; do - if [[ $arg == -- ]]; then + for arg in "$@" ; do + if [[ $arg == -- ]] ; then endopts=1 - elif [[ $arg == -* ]] && ! ((endopts)); then + elif [[ $arg == -* ]] && ! ((endopts)) ; then opts=("${opts[@]}" "$arg") else dirs=("${dirs[@]}" "$arg") fi done - if ((${#dirs[@]} == 2)); then - if [[ $PWD == *"${dirs[0]}"* ]]; then + if ((${#dirs[@]} == 2)) ; then + if [[ $PWD == *"${dirs[0]}"* ]] ; then builtin cd "${opts[@]}" \ -- "${PWD/${dirs[0]}/${dirs[1]}}" else -- cgit v1.2.3