Link to home
Start Free TrialLog in
Avatar of jjcheap1
jjcheap1

asked on

Log telnet output

Hi,
I need some help with a script. The script needs to telnet to port 1010 and capture the output to a file with a date stamp. I will run it as a cron job.

Thanks
Avatar of ravenpl
ravenpl
Flag of Poland image

use netcat

nc remote.address 1010 > filename.$(date +%s)
use netcat or expect
depending on the behaviour of your server listenening on port 1010 following might work:

#!/bin/sh
tp()
{
sleep 1
echo -e "whatever you want here"
sleep 1
echo ""
}
tp|telnet remote-host 1010
Avatar of jjcheap1
jjcheap1

ASKER

Hi,

net cat works just fine. I looked in the man pages. Is there any way to set the term to vt-100 ?

Thanks
vt-100 has nothing to do with netcat nor telnet, that's just a setting of your shell and it's parent terminal window.
ASKER CERTIFIED SOLUTION
Avatar of ravenpl
ravenpl
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial