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
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
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
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
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
nc remote.address 1010 > filename.$(date +%s)