Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion tricks
- X-seq: zsh-users 3691
- From: Stephane Bortzmeyer <stephane@xxxxxxxxxxx>
- To: Jeff Shipman <shippy@xxxxxxx>
- Subject: Re: completion tricks
- Date: Mon, 19 Mar 2001 21:47:31 +0100
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <Pine.LNX.4.31.0103191314040.4850-100000@neptune> (Jeff Shipman <shippy@xxxxxxx>'s message of Mon, 19 Mar 2001 13:14:54 MST)
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Sender: stephane@xxxxxxxxxxx
On Monday 19 March 2001, at 13 h 14, the keyboard of Jeff Shipman
<shippy@xxxxxxx> wrote:
> 2) Using ssh, rlogin, telnet, etc will complete
> different hosts on my network.
Did you notice the 'ssh_completion' file in zsh's distribution?
Anyway, here is how I do it:
# Construct an array of common hosts
etchosts=( ${(s: :)${(ps:\t:)${${(f)"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blan
k:]]#}} )
sshhosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[^0-9]*}%%\ *}%%,*})
hosts=($etchosts $sshhosts)
# SSH (scp is much more difficult)
compctl -k hosts \
-x "c[-1,-l]" -u \
- "c[-1,-i]" -f \
- "c[-1,-e]" -k "(~ none)" \
- "c[-1,-c]" -k "(idea des 3des tss arcfour none)" \
- "c[-1,-p]" -k ports \
- "c[-1,-L] c[-1,-R] c[-1,-o]" -k "()" \
-- ssh slogin
# various network programs
compctl -x 'N[-1,@]' -k hosts - 's[]' -u -qS '@' -- finger
compctl -k hosts traceroute mtr ping
Messages sorted by:
Reverse Date,
Date,
Thread,
Author