aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/cd.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-09-01 01:05:50 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-09-01 01:05:50 +1200
commita60119e7abc2b5114eb25fc0a0c7b7b83f3234d6 (patch)
tree10b737c63d0a92ad1ebca0e57c56a54c447c3a52 /bash/bashrc.d/cd.bash
parentTurns out older Bash is muddled by var=() (diff)
downloaddotfiles-a60119e7abc2b5114eb25fc0a0c7b7b83f3234d6.tar.gz
dotfiles-a60119e7abc2b5114eb25fc0a0c7b7b83f3234d6.zip
Forgot a couple of array declarations
Diffstat (limited to 'bash/bashrc.d/cd.bash')
-rw-r--r--bash/bashrc.d/cd.bash3
1 files changed, 2 insertions, 1 deletions
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash
index 0f1eba24..f16aad41 100644
--- a/bash/bashrc.d/cd.bash
+++ b/bash/bashrc.d/cd.bash
@@ -1,7 +1,8 @@
# If given two arguments to cd, replace the first with the second in $PWD,
# emulating a Zsh function that I often find useful; preserves options too
cd() {
- local opt opts OPTIND=0
+ local opt OPTIND=0
+ local -a opts
while getopts elP opt; do
opts[${#opts[@]}]=-$opt
done