Skip to content
Myr

[bash/zsh-completion] Filter ~/.ssh/known_hosts

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Close #791

authored by Junegunn Choi · committed by Junegunn Choi · parent 3670273 · Browse files · 2 files+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−2 removed

  • other:+2 added−2 removed

2 files+2 added−2 removed

modified:shell/completion.bash+1 added-1 removed
219 unmodified lines
220221_fzf_complete_ssh() {222 _fzf_complete '+m' "$@" < <(223 cat <(cat ~/.ssh/config /etc/ssh/ssh_config 2> /dev/null | command grep -i '^host' | command grep -v '*') \224 <(command grep -oE '^[^ ]+' ~/.ssh/known_hosts | tr ',' '\n' | awk '{ print $1 " " $1 }') \224 <(command grep -oE '^[a-z0-9.,-]+' ~/.ssh/known_hosts | tr ',' '\n' | awk '{ print $1 " " $1 }') \225 <(command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0') |226 awk '{if (length($2) > 0) {print $2}}' | sort -u227 )228}
83 unmodified lines
modified:shell/completion.zsh+1 added-1 removed