From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15767 invoked from network); 28 Aug 2000 14:33:13 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Aug 2000 14:33:13 -0000 Received: (qmail 22073 invoked by alias); 28 Aug 2000 14:32:25 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3404 Received: (qmail 22066 invoked from network); 28 Aug 2000 14:32:24 -0000 From: "Bart Schaefer" Message-Id: <1000828142549.ZM15410@candle.brasslantern.com> Date: Mon, 28 Aug 2000 14:25:49 +0000 In-Reply-To: Comments: In reply to Nemeth Ervin "Re: ssh completion" (Aug 28, 10:09am) References: <2gizolzu74u.fsf@dacia.kom.auc.dk> <20000826233706.A18856@picard.franken.de> X-Mailer: Z-Mail (5.0.0 30July97) To: =?iso-8859-1?Q?Thomas_K=F6hler?= Subject: Re: ssh completion Cc: zsh-users@sunsite.auc.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 28, 10:09am, Nemeth Ervin wrote: } Subject: Re: ssh completion } } Here is a bit better one: } } zstyle '*ssh*' hosts $(sed -e '/^#/d } s/ .*$// } s/,/ /g' /etc/ssh_known_hosts ~/.ssh/known_hosts) That one gives me sed: can't read /etc/ssh_known_hosts: No such file or directory so it might be a good idea to redirect stderr. Also, ~/.ssh/known_hosts is sometimes rewritten by ssh, so if the following isn't too slow, you might try it -- it re-reads the files whenever the style is tested: zstyle -e ':completion:*:ssh:*' hosts \ 'reply=($(sed -e "/^#/d" -e "s/ .*\$//" -e "s/,/ /g" \ /etc/ssh_known_hosts ~/.ssh/known_hosts 2>/dev/null))' Finally, note that the above works for ssh version 1 and openssh, but not for ssh2. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net