From: Atrate Date: Sat, 4 Dec 2021 12:22:12 +0000 (+0100) Subject: zshrc: ignore hosts set to invalid/loopback addresses for $_etc_hosts X-Git-Tag: v0.19.1~2^2 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=27e32faa47e6006fba524870d042bdbe2ef6ab85 zshrc: ignore hosts set to invalid/loopback addresses for $_etc_hosts Signed-off-by: Atrate --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 89684e4..22ed162 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -894,7 +894,7 @@ function grmlcomp () { if is42 ; then [[ -r ~/.ssh/config ]] && _ssh_config_hosts=(${${(s: :)${(ps:\t:)${${(@M)${(f)"$(<$HOME/.ssh/config)"}:#Host *}#Host }}}:#*[*?]*}) || _ssh_config_hosts=() [[ -r ~/.ssh/known_hosts ]] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() - [[ -r /etc/hosts ]] && [[ "$NOETCHOSTS" -eq 0 ]] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(