aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/cd.bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash/bashrc.d/cd.bash')
-rw-r--r--bash/bashrc.d/cd.bash10
1 files changed, 5 insertions, 5 deletions
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