diff options
author | Florian Pritz <bluewind@xinu.at> | 2020-03-26 14:03:26 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2020-09-27 15:23:14 +0200 |
commit | 37ea2266f8d0613e3d4ae5e39ab8e7188207f17e (patch) | |
tree | 30653b07d2333bc1b9ee5eced4b7a58d3c55d50f | |
parent | f69f806a2101b3997f76d89ada6ba9a2da127270 (diff) | |
download | dotfiles-37ea2266f8d0613e3d4ae5e39ab8e7188207f17e.tar.gz dotfiles-37ea2266f8d0613e3d4ae5e39ab8e7188207f17e.tar.xz |
zshrc: Only add full hostnames from work known_hosts
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | .zshrc | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -766,7 +766,7 @@ alias h=sshrc # complete ssh hostnames [[ -r ~/.ssh/known_hosts ]] && _ssh_hosts=(${${${${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}%%:*}#\[}%\]}) || _ssh_hosts=() -[[ -r ~/.ssh/known_hosts_work ]] && _ssh_hosts+=($(cut -d\ -f1 ~/.ssh/known_hosts ~/.ssh/known_hosts_work | tr , "\n" | sed -r 's#(_ecdsa|_rsa|_ed25519|_dsa)$##')) || true +[[ -r ~/.ssh/known_hosts_work ]] && _ssh_hosts+=($(cut -d\ -f1 ~/.ssh/known_hosts ~/.ssh/known_hosts_work | tr , "\n" | sed -r 's#(_ecdsa|_rsa|_ed25519|_dsa)$##' | grep -F .)) || true [[ -r ~/.ssh/config ]] && _ssh_config_hosts=($(sed -rn 's/host\s+(.+)/\1/ip' "$HOME/.ssh/config" | grep -v "\*" )) || _ssh_config_hosts=() hosts=( $HOST |