From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5771 invoked from network); 26 Jul 2005 16:23:43 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 26 Jul 2005 16:23:43 -0000 Received: (qmail 84616 invoked from network); 26 Jul 2005 16:23:37 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Jul 2005 16:23:37 -0000 Received: (qmail 2622 invoked by alias); 26 Jul 2005 16:23:29 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9187 Received: (qmail 2612 invoked from network); 26 Jul 2005 16:23:29 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 26 Jul 2005 16:23:29 -0000 Received: (qmail 83521 invoked from network); 26 Jul 2005 16:23:29 -0000 Received: from sodans.usata.org (61.211.239.46) by a.mx.sunsite.dk with SMTP; 26 Jul 2005 16:23:22 -0000 Received: from [192.168.0.3] (KHP059134020054.ppp-bb.dion.ne.jp [59.134.20.54]) by sodans.usata.org (Postfix) with ESMTP id 64C4CD43D; Wed, 27 Jul 2005 01:23:08 +0900 (JST) In-Reply-To: References: <1050724093315.ZM20733@candle.brasslantern.com> <3BF4526D-BFA6-46C7-A977-BD43DFAD4C07@jota.gsc.riken.go.jp> <10C0AB35-42EC-4270-8CC0-8ABDA5428A83@h8.dion.ne.jp> Mime-Version: 1.0 (Apple Message framework v733) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <364B3C7A-F7EC-4126-A79B-10A9833B6E10@h8.dion.ne.jp> Cc: zsh-users@sunsite.dk Content-Transfer-Encoding: 7bit From: Motoi Washida Subject: Re: outputs of _users and _hosts to arrays Date: Wed, 27 Jul 2005 01:23:13 +0900 To: Wataru Kagawa X-Mailer: Apple Mail (2.733) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.0.4 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