diff options
Diffstat (limited to 'bash/bashrc.d/cd.bash')
-rw-r--r-- | bash/bashrc.d/cd.bash | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash index a07f07b9..79e610d8 100644 --- a/bash/bashrc.d/cd.bash +++ b/bash/bashrc.d/cd.bash @@ -6,12 +6,10 @@ function cd { local opts="$opts -$opt" done shift $(($OPTIND-1)) - if [[ -n "$2" ]]; then + if [[ $# -eq 2 ]]; then builtin cd $opts "${PWD/$1/$2}" - elif [[ -n "$1" ]]; then - builtin cd $opts "$1" else - builtin cd $opts + builtin cd $opts "$@" fi } |