[email protected] (Bruno Flueckiger), 2019.05.12 (Sun) 14:39 (CEST):
> On 01.05., Marcus MERIGHI wrote:
> > Hello,
> >
> > [email protected] (Okan Demirmen), 2019.04.29 (Mon) 16:19 (CEST):
> > > On Fri 2019.04.26 at 07:15 +0200, Bruno Fl?ckiger wrote:
> > > > Hi,
> > > >
> > > > The ssh menu of cwm(1) doesn't filter duplicated hostnames when reading
> > > > them from ~/.ssh/known_hosts. This patch makes sure each hostname is
> > > > only displayed once to the menu.
> > >
> > > Sure, maybe; but why again do we even have this inside a window manager?
> > > Really, the known_hosts parsing is incomplete at best; either the entire
> > > parsing code needs to be lifted from ssh or this (mis)feature should be
> > > removed from cwm. I prefer the latter.
> >
> > FWIW, i use "M-period" a lot... are there easy alternatives?
> >
> I use dmenu[1] from suckless.org as a replacement. The following script
> reads the host names from ~/.ssh/known_hosts, feeds them to dmenu and
> executes ssh to the host I choose in an xterm:
 
Matthias, Landry, Thuban, Bruno - Thanks for your hints!

I settled for the script below. Thanks for the blueprint, Bruno!

Marcus

#!/bin/sh -eu 
_h=$(while read _l; do print ${_l%%[ ,]*}; done < ~/.ssh/known_hosts | \
  sort -u | dmenu)
exec xterm -T "[ssh] $_h" -e "ssh $_h || read _a?'enter to continue'"

Reply via email to