Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: _hosts
- X-seq: zsh-workers 22188
- From: Danek Duvall <duvall@xxxxxxxxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: PATCH: _hosts
- Date: Fri, 3 Feb 2006 11:45:01 -0800
- Cc: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- In-reply-to: <EXCHANGE0342xiC06Ix0000a0e4@xxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Danek Duvall <duvall@xxxxxxxxxxxxxx>, Peter Stephenson <pws@xxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <EXCHANGE0342xiC06Ix0000a0e4@xxxxxxxxxxxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author