From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29076 invoked from network); 3 Feb 2006 19:45:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 Feb 2006 19:45:35 -0000 Received: (qmail 24209 invoked from network); 3 Feb 2006 19:45:28 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Feb 2006 19:45:28 -0000 Received: (qmail 17025 invoked by alias); 3 Feb 2006 19:45:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22188 Received: (qmail 16992 invoked from network); 3 Feb 2006 19:45:25 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 Feb 2006 19:45:25 -0000 Received: (qmail 23974 invoked from network); 3 Feb 2006 19:45:25 -0000 Received: from lorien.comfychair.org (64.81.241.43) by a.mx.sunsite.dk with SMTP; 3 Feb 2006 19:45:23 -0000 Received: from lorien.comfychair.org (localhost [127.0.0.1]) by lorien.comfychair.org (8.13.4/8.13.4) with ESMTP id k13Jj2sn011378; Fri, 3 Feb 2006 11:45:02 -0800 Received: (from duvall@localhost) by lorien.comfychair.org (8.13.4/8.13.4/Submit) id k13Jj11w011377; Fri, 3 Feb 2006 11:45:01 -0800 Date: Fri, 3 Feb 2006 11:45:01 -0800 From: Danek Duvall To: Peter Stephenson Cc: Zsh hackers list Subject: Re: PATCH: _hosts Message-ID: <20060203194501.GC23141@lorien.comfychair.org> Mail-Followup-To: Danek Duvall , Peter Stephenson , Zsh hackers list References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: mutt-ng/devel-r535 (Linux) On Fri, Feb 03, 2006 at 03:46:08PM +0000, Peter Stephenson wrote: > I've also made the function search ~/.ssh/known_hosts for host names > (and strip out IPv4 dot addresses). > > [ ... ] > > sed -e '/^[0-9]*\.[0-9]*\.[0-9]*\.[0-9]/d' -e 's/[ ,].*//p' ~/.ssh/known_hosts Might want to strip out IPv6 addresses as well: -e '/^[0-9a-f]\{0,4\}:/d' And I'm not sure I see what the "/p" is doing there, other than doubling each entry. Would ${${${(u)${(f)"$(<~/.ssh/known_hosts)"}%%[ ,]*}:#(#s)[0-9]##.[0-9]##.[0-9]##.[0-9]##(#e)}:#(#s)[0-9a-f:]##(#e)} be any better (if more arcane)? Danek