Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Hostname Menu completion
- X-seq: zsh-users 6719
- From: Stephane Bortzmeyer <stephane@xxxxxxxxxxx>
- To: Leslie Joshua Wang <rexo@xxxxxxxxxxxxx>
- Subject: Re: Hostname Menu completion
- Date: Mon, 20 Oct 2003 21:18:11 +0200
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <F5FA898F-0313-11D8-9531-000393AB66AA@xxxxxxxxxxxxx> (Leslie Joshua Wang <rexo@xxxxxxxxxxxxx>'s message of Mon, 20 Oct 2003 23:42:07 +0800)
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
On Monday 20 October 2003, at 23 h 42, the keyboard of Leslie Joshua Wang
<rexo@xxxxxxxxxxxxx> wrote:
> Does anyone have any suggestion what is the best way to go about
> creating a hostname completion system using zsh?
I believe that zsh has a different way to do it in its most recent versions
but this works for me:
etchosts=( ${(s: :)${(ps:\t:)${${(f)"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blan
k:]]#}} )
sshhosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*})
ftphosts=(${${${(f)"$(tail +3 $HOME/.ncftp/bookmarks)"}#*,}%%,*})
hosts=($etchosts $sshhosts $ftphosts)
ncftpbookmarks=(${${(f)"$(tail +3 $HOME/.ncftp/bookmarks)"}%%,*})
ncftphosts=($ncftpbookmarks $ftphosts)
compctl -k hosts traceroute mtr ping echoping fping tcptraceroute
Messages sorted by:
Reverse Date,
Date,
Thread,
Author