Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: hostname completion for ssh / scp
- X-seq: zsh-users 22084
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: hostname completion for ssh / scp
- Date: Fri, 4 Nov 2016 21:42:37 -0700
- Cc: Fourhundred Thecat <400thecat@xxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject:cc :mime-version; bh=imfNVY868mrlt0gxzJ98/gKnfaRSiGhXLwFkVaJDhOE=; b=yZNvGCRsfqFr4+2ogoFo99hi/Gp6QLPOVug7OHn2z3wLWz0p4ANv7f5qcVvNlcPqLD Dyr5Y7vzMzSi6jd31cJH0g2M37H/qgQ1/D2wf3PDOnqWksSzN8bBNeXLja+73drbf/J+ Go749VwhmLkwakxViAoWppyM2DrBIXDQ9evGP4jvBTe8ci2AkDao+IgsPu24Y1NpyloO 6SublCruyDmXqFK8FZB00qqI25UglF/03sy4eKNWg+KNzE0issFiSgDOMdEIlrf1ry0J sTPAyhuE/htBbtKimg++/CvR+rBmtF/2RddxW7pVaY+bu/T87GgQa7rlX6LTEslhlM5E shng==
- In-reply-to: <581B8BCE.2040108@gmx.ch>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <581B8BCE.2040108@gmx.ch>
On Nov 3, 8:11pm, Fourhundred Thecat wrote:
} Subject: hostname completion for ssh / scp
}
} ssh <TAB>
}
} it offers me only the hostnames listed in ~/.ssh/config and completely
} ignores global ones defined in /etc/hosts
}
} Tested on zsh 4.3.17
What does
getent hosts
return on your system? That's where _hosts gets the list of hosts.
Only if getent isn't present does it look directly at /etc/hosts,
and also at "ypcat hosts" if there is ypcat.
If getent isn't returning anything useful, you can replace it:
zstyle ':completion:*:hosts' command 'cat /etc/hosts'
Or explicitly list all the hosts yourself:
zstyle ':completion:*:hosts' hosts $(awk '/^[^#]/ {print $2}' /etc/hosts)
Note there have been several other fixes/improvements to ssh host-gathering
since zsh 5.0.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author