Expect Script to automate Telnet login and Logs to File and Print Output.
Hi I am try to get an expect script to telnet and login to a Panasonic and collect the call log to a file and print the new lines as calls are completed.
I am able to login successfully and write call to a log file, but can not print the output.
#!/usr/bin/expect
#!/home/pi/Documents
spawn telnet
expect "telnet>"
send "open 192.168.0.101 2300\r"
expect "Connected to 192.168.0.101."
send "\r"
expect "*"
send "smdr\r"
expect "Enter Password:"
send "pccsmdr\r"
log_file telnetlog.txt
# timout while testing
set timeout 60
#will never match
expect "salmon*"
Thanks in Advance
Last edited by whatsup; 03-15-2016 at 09:46 AM.
Reason: add addiy
|