diff options
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc.d/cd.bash | 3 | ||||
-rw-r--r-- | bash/bashrc.d/ssh.bash | 2 |
2 files changed, 3 insertions, 2 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 diff --git a/bash/bashrc.d/ssh.bash b/bash/bashrc.d/ssh.bash index e4ca1dec..93aeecbd 100644 --- a/bash/bashrc.d/ssh.bash +++ b/bash/bashrc.d/ssh.bash @@ -1,8 +1,8 @@ # Commpletion for ssh/sftp/ssh-copy-id with config hostnames _ssh() { local config=$HOME/.ssh/config - local hosts=() local word=${COMP_WORDS[COMP_CWORD]} + local -a hosts # Bail if the configuration file is illegible if [[ ! -r $config ]]; then |