Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: {(t)...} usage
- X-seq: zsh-users 5057
- From: Eric Gillespie <epg@xxxxxxxxxxxxxx>
- To: Mario Lang <mlang@xxxxxxxxxxx>
- Subject: Re: {(t)...} usage
- Date: Sat, 15 Jun 2002 16:29:18 -0500
- Cc: zsh-users@xxxxxxxxxxxxxx
- In-reply-to: Message from Mario Lang <mlang@xxxxxxxxxxx> of "Fri, 14 Jun 2002 17:06:37 +0200." <87it4l7vcy.fsf@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <87it4l7vcy.fsf@xxxxxxxxxxxxxxxx>
- Sender: epg@xxxxxxxxxxxxxxxxxxxxxx
Mario Lang <mlang@xxxxxxxxxxx> writes:
> Can anyone give me an example on how to do this?
Here's how i do host completion based purely on ssh known_hosts
files. This strips newlines and comments.
my_hosts=(${(M)${${${${(f)"$(<~/.ssh/known_hosts2)"}:#[0-9]*}%%\ *}%%,*}:#^\#})
etc_file=/etc/ssh/ssh_known_hosts2
if [[ -f $etc_file ]]; then
etc_hosts=(${(M)${${${${(f)"$(<$etc_file)"}:#[0-9]*}%%\ *}%%,*}:#^\#})
fi
zstyle ':completion:*:*:(ping|nc|s(sh|cp)):*' hosts $etc_hosts $my_hosts
--
Eric Gillespie <*> epg@xxxxxxxxxxxxxx
Conformity is a sin.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author