Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Ssh completion from ~/.ssh/config
- X-seq: zsh-users 20109
- From: Artur Penttinen <arto-p@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Ssh completion from ~/.ssh/config
- Date: Wed, 08 Apr 2015 09:42:36 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1428475357; bh=TUWkYgmP0PLr5q0WwelZfFOw5buXE0mUJ/z5e/rAzMo=; h=From:To:In-Reply-To:References:Subject:Date; b=v1lAH89WU0t+xopLz9nb49SFkCAtrmNNbtsxA0DDF6gqeMRk6lfHURoNE9BsQVezd xDLKlhIrjh7x5zFsIfOS0xftU2lyvj9Eq3Ez4kOLcTcrhNzcmnmiy5g65Ki1v1tcIF 8wKO7O0ZnQaHeMX6Fh7DdnUenTdKFJpOmXFvHlFQ=
- In-reply-to: <1797284.9M4pHoONQN@note>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CABZhJg-8fQyOsYLHwYKoDx8DxOsReeZzfhtoi5fV_DDUQ-ziZA@mail.gmail.com> <1797284.9M4pHoONQN@note>
07.04.2015, 17:34, "Vadim A. Misbakh-Soloviov" <mva@xxxxxxxx>:
> ```
> # Hostnames completion.
> zstyle -e ':completion:*:hosts' hosts 'reply=(
> ${${${${${(f)"$(<${HOME}/.ssh/known_hosts)"//\[/}//\]:/ }:#[\|]*}%%\
> *}%%,*}
> ${${${(@M)${(f)"$(<${HOME}/.ssh/config)"}:#Host *}#Host }:#*[*?]*}
> ${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}#*[[:blank:]]}}
> )'
> zstyle ':completion:*:*:*:hosts' ignored-patterns 'ip6*' 'localhost*'
>
> ```
ssh_config Host statement can contains many names separated by whitespaces.
So ${${${(@M)${(f)"$(<${HOME}/.ssh/config)"}:#Host *}#Host }:#*[*?]*} should be
${(s. .)${${${(@M)${(f)"$(<${HOME}/.ssh/config)"}:#Host *}#Host }:#*[*?]*}}, i suppose.
--
wbw, artur
Messages sorted by:
Reverse Date,
Date,
Thread,
Author