From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29140 invoked from network); 4 Aug 1998 15:59:40 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 4 Aug 1998 15:59:40 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id LAA10417; Tue, 4 Aug 1998 11:51:32 -0400 (EDT) Resent-Date: Tue, 4 Aug 1998 11:31:16 -0400 (EDT) Message-ID: <19980804173325.K9765@math.fu-berlin.de> Date: Tue, 4 Aug 1998 17:33:25 +0200 From: Sven Guckes To: zsh-users@math.gatech.edu Subject: Re: compctl - using hostnames with rlogin, rsh, and ssh Mail-Followup-To: zsh-users@math.gatech.edu References: <19980730230755.B6503@math.fu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93i In-Reply-To: ; from Todd Graham Lewis on Mon, Aug 03, 1998 at 11:38:55PM -0400 X-Mailer: Mutt http://www.mutt.org/ X-Editor: Vim http://www.vim.org/ X-Info: http://www.math.fu-berlin.de/~guckes/ Resent-Message-ID: <"GXyge.0.VK2.3bonr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1701 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Quoting Todd Graham Lewis (tlewis@mindspring.net): > 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@math.fu-berlin.de 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