diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-18 01:44:36 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-18 01:44:36 +1200 |
commit | e8911b20d610acd0403995f832c02900b1ea061e (patch) | |
tree | f399a5bfbda989b389a8e910faf44045b36fdea2 /bash/bashrc.d/cd.bash | |
parent | Remove extraneous quoting (diff) | |
download | dotfiles-e8911b20d610acd0403995f832c02900b1ea061e.tar.gz dotfiles-e8911b20d610acd0403995f832c02900b1ea061e.zip |
Use arithmetic expansion for argument count test
Diffstat (limited to 'bash/bashrc.d/cd.bash')
-rw-r--r-- | bash/bashrc.d/cd.bash | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash index 860b65b5..186ddceb 100644 --- a/bash/bashrc.d/cd.bash +++ b/bash/bashrc.d/cd.bash @@ -6,7 +6,7 @@ __cd() { opts[${#opts[@]}]="-$opt" done shift $(($OPTIND-1)) - if [[ $# -eq 2 ]]; then + if (($# == 2)); then if [[ "$PWD" == *"$1"* ]]; then builtin cd "${opts[@]}" "${PWD/$1/$2}" else |