C
ccc31807
I'm not a network programmer, and don't even know if this is possible.
I connect to a remote machine using telnet, and run some commands,
which result in screen output. I would like to redirect this output to
a file rather than to the console. I need to work within the following
parameters:
1. I can't use FTP, but only telnet (I know how weird this must
sound).
2. I use a VPN tunnel, so I have invoke a VPN client and to use expect
to check for user and password prompts.
3. The remote machine requires authentication, so I have to use expect
to check for user and password prompts.
4. I can easily automate the commands I use to generate the output,
but all this goes to standard output (on my machine).
5. Several years ago, I wrote something like this using multiple
threads (a VPN thread to connect to the server, a query thread to run
the commands, and an FTP thread to download the data), but now FTP has
been disables and all I have is telnet.
Ideally, I would like to capture the output of the commands in a text
file so that I can process the file and generate some reports.
Can I redirect output from a stream socket to a text file dynamically
during the runtime of a script? if so, any clues as to how to do that?
Thanks, CC.
I connect to a remote machine using telnet, and run some commands,
which result in screen output. I would like to redirect this output to
a file rather than to the console. I need to work within the following
parameters:
1. I can't use FTP, but only telnet (I know how weird this must
sound).
2. I use a VPN tunnel, so I have invoke a VPN client and to use expect
to check for user and password prompts.
3. The remote machine requires authentication, so I have to use expect
to check for user and password prompts.
4. I can easily automate the commands I use to generate the output,
but all this goes to standard output (on my machine).
5. Several years ago, I wrote something like this using multiple
threads (a VPN thread to connect to the server, a query thread to run
the commands, and an FTP thread to download the data), but now FTP has
been disables and all I have is telnet.
Ideally, I would like to capture the output of the commands in a text
file so that I can process the file and generate some reports.
Can I redirect output from a stream socket to a text file dynamically
during the runtime of a script? if so, any clues as to how to do that?
Thanks, CC.