aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/ssh.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-07-30 01:17:09 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-07-30 02:09:30 +1200
commit4cbbd121c012b3962f12fdff0f1820c3b8636a44 (patch)
tree00149270df365ed0b7a1b9e9f4922fe7d5a80eb3 /bash/bashrc.d/ssh.bash
parentChange ca from Bash func to sh script (diff)
downloaddotfiles-4cbbd121c012b3962f12fdff0f1820c3b8636a44.tar.gz
dotfiles-4cbbd121c012b3962f12fdff0f1820c3b8636a44.zip
Move bash completion setup into separate dir
Diffstat (limited to 'bash/bashrc.d/ssh.bash')
-rw-r--r--bash/bashrc.d/ssh.bash22
1 files changed, 0 insertions, 22 deletions
diff --git a/bash/bashrc.d/ssh.bash b/bash/bashrc.d/ssh.bash
deleted file mode 100644
index bbb9b246..00000000
--- a/bash/bashrc.d/ssh.bash
+++ /dev/null
@@ -1,22 +0,0 @@
-# Completion for ssh/sftp/ssh-copy-id with config hostnames
-_ssh() {
-
- # Read hostnames from existent config files, no asterisks
- local -a hosts
- local config option value
- for config in "$HOME"/.ssh/config /etc/ssh/ssh_config ; do
- [[ -e $config ]] || continue
- while read -r option value _ ; do
- [[ $option == Host ]] || continue
- [[ $value != *'*'* ]] || continue
- hosts[${#hosts[@]}]=$value
- done < "$config"
- done
-
- # Generate completion reply
- for host in "${hosts[@]}" ; do
- [[ $host == "${COMP_WORDS[COMP_CWORD]}"* ]] || continue
- COMPREPLY[${#COMPREPLY[@]}]=$host
- done
-}
-complete -F _ssh -o default ssh sftp ssh-copy-id