summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2020-02-17 10:29:29 +0100
committerFlorian Pritz <bluewind@xinu.at>2020-09-27 15:22:58 +0200
commit4e7a903a99e67fa97d29e54912df51aec9fa8ff5 (patch)
tree4f589db92b1dc2fa16a79b7b5e4f6d0af2e9805b
parent13c880673c8bc5455127d6de1576584a2efb8077 (diff)
downloaddotfiles-4e7a903a99e67fa97d29e54912df51aec9fa8ff5.tar.gz
dotfiles-4e7a903a99e67fa97d29e54912df51aec9fa8ff5.tar.xz
zshrc: Fix known_hosts_work completion
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--.zshrc2
1 files changed, 1 insertions, 1 deletions
diff --git a/.zshrc b/.zshrc
index 4104e0f..47f9a7b 100644
--- a/.zshrc
+++ b/.zshrc
@@ -763,7 +763,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+=(${${${${${${${(f)"$(sed -r 's#_(rsa|ed25519|ecdsa|dsa),#,#;' <$HOME/.ssh/known_hosts_work)"}:#[\|]*}%%\ *}%%,*}%%:*}#\[}%\]}) || 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)$##')) || true
[[ -r ~/.ssh/config ]] && _ssh_config_hosts=($(sed -rn 's/host\s+(.+)/\1/ip' "$HOME/.ssh/config" | grep -v "\*" )) || _ssh_config_hosts=()
hosts=(
$HOST