tags:

views:

76

answers:

1

I have to connect to a remote server via telnet and want to send file input there.

This is a processor emulator (MCF68k), so I can't just scp the file to the server and run from there.

I can send input like this:

telnet host.name < input.file

Which will successfully transmit the data to the server and run the commands stored that I want. However, I need the telnet session to stay interactive (not terminate).

How do I pipe a file to a command, then return control of stdin to the terminal and keep the interactive session open?

+1  A: 

Does cat input.file - | telnet host.name work?

Jack Kelly
Unfortunately, no. Although that does seem to work for other commands, such as `cat input.file - | xxd`. It seems that the telnet connection is using `getch` or some equivalent - don't know if that's messing with it or what.
Jamie Wong
Irritating. I can't think of anything else off-hand, sorry.
Jack Kelly
This may not work due to flushing of `stdin`, and maybe the fact that input will not be from a tty? What a pain.
Matt Joiner