zsh-users
 help / color / mirror / code / Atom feed
* ssh completion
@ 2000-08-26 19:58 Claus Alboege
  2000-08-26 21:37 ` Thomas Köhler
  0 siblings, 1 reply; 4+ messages in thread
From: Claus Alboege @ 2000-08-26 19:58 UTC (permalink / raw)
  To: zsh-users

Hi

Could anyone tell, how I get zsh to read hostnames from
~/.ssh/known_hosts instead of /etc/hosts using zstyle?


-- 
Mvh Claus Albøge

--
% rm -f *;o
% command not found: o


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ssh completion
  2000-08-26 19:58 ssh completion Claus Alboege
@ 2000-08-26 21:37 ` Thomas Köhler
  2000-08-28  8:09   ` Nemeth Ervin
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Köhler @ 2000-08-26 21:37 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 632 bytes --]

On Sat, Aug 26, 2000 at 09:59:16PM +0200,
Claus Alboege <tractrix@kom.auc.dk> wrote:
> 
> Hi
> 
> Could anyone tell, how I get zsh to read hostnames from
> ~/.ssh/known_hosts instead of /etc/hosts using zstyle?

zstyle '*ssh*' hosts $(sed -e 's/ .*//' ~/.ssh/known_hosts)

Not perfect, but you should get the idea...

CU,
Thomas

-- 
 Thomas Köhler Email:   jean-luc@picard.franken.de     | LCARS - Linux
     <><        WWW:     http://jeanluc-picard.de      | for Computers
                IRC:             jeanluc               | on All Real
               PGP public key available from Homepage! | Starships

[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ssh completion
  2000-08-26 21:37 ` Thomas Köhler
@ 2000-08-28  8:09   ` Nemeth Ervin
  2000-08-28 14:25     ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Nemeth Ervin @ 2000-08-28  8:09 UTC (permalink / raw)
  To: Thomas Köhler; +Cc: zsh-users

Thomas Köhler <jean-luc@picard.franken.de> writes:

> On Sat, Aug 26, 2000 at 09:59:16PM +0200,
> Claus Alboege <tractrix@kom.auc.dk> wrote:
> > 
> > Could anyone tell, how I get zsh to read hostnames from
> > ~/.ssh/known_hosts instead of /etc/hosts using zstyle?
> 
> zstyle '*ssh*' hosts $(sed -e 's/ .*//' ~/.ssh/known_hosts)
> 
> Not perfect, but you should get the idea...

Here is a bit better one:

zstyle '*ssh*' hosts $(sed -e '/^#/d
s/ .*$//
s/,/ /g' /etc/ssh_known_hosts ~/.ssh/known_hosts)

HTH,
-- 
Ervin
						"Intelligenti pauca."


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ssh completion
  2000-08-28  8:09   ` Nemeth Ervin
@ 2000-08-28 14:25     ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2000-08-28 14:25 UTC (permalink / raw)
  To: Thomas Köhler; +Cc: zsh-users

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   


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-08-28 14:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-26 19:58 ssh completion Claus Alboege
2000-08-26 21:37 ` Thomas Köhler
2000-08-28  8:09   ` Nemeth Ervin
2000-08-28 14:25     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).