Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: compctl - using hostnames with rlogin, rsh, and ssh
- X-seq: zsh-users 1701
- From: Sven Guckes <guckes@xxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: compctl - using hostnames with rlogin, rsh, and ssh
- Date: Tue, 4 Aug 1998 17:33:25 +0200
- In-reply-to: <Pine.LNX.3.96.980803233328.19072E-100000@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>; from Todd Graham Lewis on Mon, Aug 03, 1998 at 11:38:55PM -0400
- Mail-followup-to: zsh-users@xxxxxxxxxxxxxxx
- References: <19980730230755.B6503@xxxxxxxxxxxxxxxxx> <Pine.LNX.3.96.980803233328.19072E-100000@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Quoting Todd Graham Lewis (tlewis@xxxxxxxxxxxxxx):
> compctl -k hostlist ssh
>
> function hosts(){
> unset hostlist
> echo "Enter password on hunterd for host completion. "
> set -A hostlist `echo "select hostname,status from hosttable;"\
> | ssh dbserver "psql hostdb 2>/dev/null"\
> | grep Active\
> | sed 's/|/ /g'\
> | awk '{print $1}'`
> # echo "hosts are $hostlist"
> }
Looks like this could take quite a while to process.
I would rather use a given deafult list of hosts.
Here is the solution with the zsh setup at our site:
hosts="" # make hosts an empty list
if [[ -f ~/.zshhosts ]]; then
# read in host list from ~/.zshhosts
hosts=$(< ~/.zshhosts)
set -A hosts ${(f)hosts}
else
# set the default host list
hosts=(erdos euler gauss leibniz pascal)
compctl -k hosts -x 'p[2,-1]' -l '' -- rsh ssh
compctl -k hosts -x 'c[-1,-l]' -u -- rlogin
Comments?
Sven
--
Sven Guckes guckes@xxxxxxxxxxxxxxxxx using zsh-3.0.5 [961218]
ZSH HomePage: http://www.zsh.org | Latest version: zsh-3.1.4 [980601]
ZSH Pages: http://www.math.fu-berlin.de/~guckes/zsh/ Tips and tricks
Messages sorted by:
Reverse Date,
Date,
Thread,
Author