I try to automate some things for my Midnight Commander setup and want to call an internal Midnight Commander command from menu entries or key bindings.
For example, I have a large number of ssh sites defined in .ssh/config,
# ssh (secure shell) configuration file
Host test1
HostName 123.456.789.0
Port 980
User MyUserName
Host test2
HostName test.mynet.local
User test
CheckHostIP no
..
I want to filter and sort the aliases from .ssh/config (for example with):
grep '^Host ' .ssh/config | cut -d ' ' -f 2 | sort
Store the resulting list in a Midnight Commander internal list box or selection panel.
Select one of the entries and call the remote shell for the right file panel (like mc sh://%s...).
At least I want to store the procedure to a key binding or a Midnight Commander menu entry.
Could this be done with Midnight Commander board tools or configuration files?