zsh-users
 help / color / mirror / code / Atom feed
* Hostname Menu completion
@ 2003-10-20 15:42 Leslie Joshua Wang
  2003-10-20 19:18 ` Stephane Bortzmeyer
  0 siblings, 1 reply; 2+ messages in thread
From: Leslie Joshua Wang @ 2003-10-20 15:42 UTC (permalink / raw)
  To: zsh-users

Hi All,

I am trying to learn about menu completion.

In my course of work, I may have to remote log in to many systems, 
listed on the NIS/DNS.

Does anyone have any suggestion what is the best way to go about 
creating a hostname completion system using zsh?




Best Regards,
Leslie Joshua Wang


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Hostname Menu completion
  2003-10-20 15:42 Hostname Menu completion Leslie Joshua Wang
@ 2003-10-20 19:18 ` Stephane Bortzmeyer
  0 siblings, 0 replies; 2+ messages in thread
From: Stephane Bortzmeyer @ 2003-10-20 19:18 UTC (permalink / raw)
  To: Leslie Joshua Wang; +Cc: zsh-users

On Monday 20 October 2003, at 23 h 42, the keyboard of Leslie Joshua Wang 
<rexo@ubergoonz.com> 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-10-20 19:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-20 15:42 Hostname Menu completion Leslie Joshua Wang
2003-10-20 19:18 ` Stephane Bortzmeyer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).