[Nottingham] Telnet with 'comfort shell' features for talkinjg to dumb server control programs
Robert Davies
nottingham at mailman.lug.org.uk
Sat Feb 15 13:18:03 2003
On Saturday 15 February 2003 11:01, you wrote:
> Hi Rob,
>
> On Sat, 15 Feb 2003, Robert Davies wrote:
> > I'm having to use ssh more onto a server in the net and then talk to
> > various client daemons over telnet. It's not repetitive enough to
> > automate using except(1), but the lack of up-arrow and history features
> > are driving me barmy.
>
> You could use ssh to tunnel through to the various services using local
> port forwarding. This may save you a good deal of time. As far as your
> scripts are concerned, the listening port for the service is on your local
> machine since that is where you can get to the service.
Yes, but it's the basic interface of what I have to connect to interactively
that's the issue, not the connecting.
I said telnet, but it's not the telnet port I am talking about, I use telnet
like this often :
telnet some.where.broken.net smtp
telnet some.slow.web.server.net www
telnet some.dumb.daemon.net 3324
> > Surely someone has had this problem before? There must be a
> > 'pseudo-shell' which does history and file completion, but punts all the
> > commands on to the tcp/ip server process you are talking to? This would
> > even be useful for manual checking on webservers, and fixing mailer
> > daemons, where you can reload a configuration on the flie and don't have
> > access to GUI environment.
>
> I've come across similar problems before. Your best bet may be to use
> Perl and the Term::ReadLine interface. You control when items get added
> to the history and it may solve your problem. Command completion may be
> possible with a similar, related CPAN module (Term::Complete). Let me know
> if you need a hand writing the script...
It's a good idea, certainly if I build a GNU cliant then Readline is the
obvious solution, can probably steal C code from expect, but Perl does have
it all already in Modules, so could prototype the idea, even if I turn it
into a mini- C project eventually.
Rob