Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: outputs of _users and _hosts to arrays
- X-seq: zsh-users 9187
- From: Motoi Washida <a66@xxxxxxxxxxxxx>
- To: Wataru Kagawa <wkagawa@xxxxxxxxxxxxxxxxxxxx>
- Subject: Re: outputs of _users and _hosts to arrays
- Date: Wed, 27 Jul 2005 01:23:13 +0900
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <FCECEA34-165D-4F84-9316-365ECE23E3DB@xxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <DC95ADD4-4F3C-4024-A9BE-242EC503D12C@xxxxxxxxxxxxxxxxxxxx> <1050724093315.ZM20733@xxxxxxxxxxxxxxxxxxxxxxx> <3BF4526D-BFA6-46C7-A977-BD43DFAD4C07@xxxxxxxxxxxxxxxxxxxx> <10C0AB35-42EC-4270-8CC0-8ABDA5428A83@xxxxxxxxxxxxx> <FCECEA34-165D-4F84-9316-365ECE23E3DB@xxxxxxxxxxxxxxxxxxxx>
On 07/26/2005, at 10:56, Wataru Kagawa wrote:
hosts=( ${$( cat /etc/hosts | cut -d : -f 1,7 | grep -v
"#" )//:*/} )
to get what I need.
This has the same problem, but I don't know a better way well.
Using some functions from Perl or some other language?
Do you mean that the commands inside the parameter expansion may
work on Mac OS X but not on other computers?
On some systems using NIS, you can get host names of your network
from shared database, IIRC.
But I think you can get better results by setting hosts manually.
% zstyle ':completion:*' hosts ${${(f)"$(<~/.ssh/known_hosts)"}%%
[[:space:],]*}
see http://www.zsh.org/mla/users/2005/msg00084.html
Messages sorted by:
Reverse Date,
Date,
Thread,
Author