telnet i/o redirection?

Bruce G. Barnett barnett at vdsvax.steinmetz.ge.com
Mon Apr 18 22:07:59 AEST 1988


In article <443 at ncifcrf.ncifcrf.gov> randy at ncifcrf.gov (The Computer Grue) writes:

 [ telnet with a script]

|This means that you need to send
|<CR> to end lines instead of <LF>, which is the normal unix end of
|line character. 

Don't forget the Login: and Password: lines. These are not
terminated by <CR> or <LF>. 

I hacked together a simple program for a remote telnet script.  (Our
Internet gateway doesn't do IP forwarding and isn't BSD based.)  I am
not satified I did it the most efficient way. I forked a telnet
process and connected to it using pipes. I then used fcntl to add the
FNDELAY flag.

I experimented with different values to distinguish from a timeout and
a line without a <cr><lf>. I wrote my own buffering scheme.

Anyhow, the program works - more-or-less, but I can't help wondering
is there is a better way.

Anyone have any suggestions?
I plan to study the sources of telnet and rlogin - for inspiration.
Sigh ... it is amazing how a simple 2-hour hack grows in size to fill
all available time.
-- 
	Bruce G. Barnett 	<barnett at ge-crd.ARPA> <barnett at steinmetz.UUCP>
				uunet!steinmetz!barnett



More information about the Comp.unix.questions mailing list