Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#430146: zsh: please add .ssh/config Hosts to the hosts zstyle completion
- X-seq: zsh-workers 23596
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Bug#430146: zsh: please add .ssh/config Hosts to the hosts zstyle completion
- Date: Sun, 24 Jun 2007 12:44:06 -0700
- Cc: Pierre Habouzit <madcoder@xxxxxxxxxx>
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=first1; d=spodhuis.org; h=Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=jjP2B1I89UOn4ErJnRoKS9HBa88L29YfN3m1TWOshwtsV632Me/+q3OFCyzOf3Q5Bi0neO9ksqaPM59lUu46ARa4fWWF6GGtgxkXYKYVPvlS+egPYtZBRR6X7dT/H0aAPaFcQpPM8Ei4BU0VobwSCqt3qzCQyhBzPYfza8HBBuI=;
- In-reply-to: <20070624115727.GA31510@xxxxxxxxxxx>
- Mail-followup-to: zsh-workers@xxxxxxxxxx, Pierre Habouzit <madcoder@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20070622180648.14337.68045.reportbug@localhost> <20070622211507.GA16349@xxxxxxxxxxx> <20070622222216.GA9656@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20070623074721.GA28769@xxxxxxxxxxx> <20070623113320.GA25562@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20070624115727.GA31510@xxxxxxxxxxx>
On 2007-06-24 at 07:57 -0400, Clint Adams wrote:
> On Sat, Jun 23, 2007 at 12:33:21PM +0100, Pierre Habouzit wrote:
> > Anyways, I'm not using it anymore because I fancy the
> > .ssh/known_hosts more, but I miss it :)
>
> We could do something like this to generate matches from ~/.ssh/config .
> Anyone have better ideas?
The Hosts lines in .ssh/config are glob patterns. Both '*' and '?' are
valid characters. With farms of machines under a consistent naming
scheme, this comes into play.
Further, multiple patterns can be on the same line, so you can have
hostnames and patterns. I look at my config now ... ugh. Way to make
things bad: have a section of your ~/.ssh/config delimited by magic
comments used by another script when generating an updated config file.
> + if zstyle -t ":completion:${curcontext}:hosts" use-ssh-config; then
> + [[ -r ~/.ssh/config ]] && _cache_hosts+=(${=${${(M)${(f)"$(<~/.ssh/config)"}:#Host*}#Host }:#*\**})
> + fi
I think that:
${=${${(M)${(f)"$(<~/.ssh/config)"}:#Host*}#Host }:#*\**}
should be:
${${=${(M)${(f)"$(<~/.ssh/config)"}:#Host*}#Host }:#*[\*\?]*}
This splits on $IFS earlier so that the outer :# filter applies on a
per-item basis instead of per-line, and adds '?' to the filter pattern.
And people wonder why I laugh when they describe _Perl_ as a line-noise
language. ;-)
Regards,
-Phil
Messages sorted by:
Reverse Date,
Date,
Thread,
Author