Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ssh completion
- X-seq: zsh-users 3404
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Thomas Köhler <jean-luc@xxxxxxxxxxxxxxxxx>
- Subject: Re: ssh completion
- Date: Mon, 28 Aug 2000 14:25:49 +0000
- Cc: zsh-users@xxxxxxxxxxxxxx
- In-reply-to: <gmv7l91x0wj.fsf@xxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <2gizolzu74u.fsf@xxxxxxxxxxxxxxxx> <20000826233706.A18856@xxxxxxxxxxxxxxxxx> <gmv7l91x0wj.fsf@xxxxxxxxxxxxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author