aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/cd.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-08-18 01:43:16 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-08-18 01:43:16 +1200
commit6519700f6ad799c50794876eec6f2bebc13dfc72 (patch)
tree2164af2afd1ed41bdb69ef3be0854fdd9542b6f8 /bash/bashrc.d/cd.bash
parentPracticing writing half-decent Bash (diff)
downloaddotfiles-6519700f6ad799c50794876eec6f2bebc13dfc72.tar.gz
dotfiles-6519700f6ad799c50794876eec6f2bebc13dfc72.zip
Remove extraneous quoting
Overkill for expansions that will be integers by definition
Diffstat (limited to 'bash/bashrc.d/cd.bash')
-rw-r--r--bash/bashrc.d/cd.bash6
1 files changed, 3 insertions, 3 deletions
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash
index 6c2e463f..860b65b5 100644
--- a/bash/bashrc.d/cd.bash
+++ b/bash/bashrc.d/cd.bash
@@ -3,10 +3,10 @@
__cd() {
local -a opts
while getopts elP opt; do
- opts["${#opts[@]}"]="-$opt"
+ opts[${#opts[@]}]="-$opt"
done
- shift "$(($OPTIND-1))"
- if [[ "$#" -eq 2 ]]; then
+ shift $(($OPTIND-1))
+ if [[ $# -eq 2 ]]; then
if [[ "$PWD" == *"$1"* ]]; then
builtin cd "${opts[@]}" "${PWD/$1/$2}"
else