Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: compctl - using hostnames with rlogin, rsh, and ssh



On Tue, Aug 04, 1998 at 09:11:10PM +0200, Sven Guckes wrote:

> > 	if [[ -f ~/.zshhosts ]]; then
> > 	  # read in host list from ~/.zshhosts
> > 	  hosts=$(< ~/.zshhosts)
> 
> Quoting Roland Jesse (jesse@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx):
> > Does it matter whether the hostnames in ~/.zshhosts are
> > all stored in one big line or in one line per host name?
> 
> Well, my ~/.zshhosts has one hostname per line.
> Dunno whether it'll work with all hosts on one line.
> Oh, heck, I'll give it a try:
> 
> 	:%j
> 	:w
> 	:shell
> 	$ ssh <TAB>
> 	$ ssh erdos\ euler\ gauss\ leibniz\ pascal\ 
> 
> Nope, doesn't seem to work.

Not this way, no. You did a
   hosts=$(< ~/.zshhosts)
which doesn't work because all is in a variable. Try an array instead:
   hosts=($(< ~/.zshhosts))
This will work whether or not all hosts are in one line or there is one
hostname per line.

~> shosts=($(< sshhosts))
~> compctl -k shosts ssh
~> ssh a<tab>
~> ssh automatix.informatik.uni-wuerzburg.de
~> rhosts=($(< rshhosts))
~> compctl -k rhosts rsh
~> rsh a<tab>
~> rsh automatix.informatik.uni-wuerzburg.de
~> < sshhosts
automatix.informatik.uni-wuerzburg.de
datenbus.mayn.de
picard.franken.de
willkuere.informatik.uni-wuerzburg.de
~> < rshhosts
automatix.informatik.uni-wuerzburg.de datenbus.mayn.de picard.franken.de willkuere.informatik.uni-wuerzburg.de
~>

> Sven  ['u', ":w" ;-)]

CU,
Thomas

-- 
    Thomas Köhler    Email:     jean-luc@xxxxxxxxxxxxxxxxx
        <><           WWW:    http://home.pages.de/~jeanluc/
                      IRC:               jeanluc
      LCARS --- Linux for Computers on All Real Starships



Messages sorted by: Reverse Date, Date, Thread, Author