I am running Tcl script for connecting Telnet port. For this script I want to store all the CMD output in a log file. how to do this in Tcl script? Script as below:
#!/usr/bin/expect -f
#!usr/bin/expect
package require Expect
spawn telnet $serverName $portNum
expect "TradeAggregator>"
send "Clients\r"
expect "Client:"
send "1\r"
expect "1-Client>"
send "Pollers\r"
expect "Client Pollers"
send "2\r"
send "n\r"
expect ">"
set passwordOption $expect_out(buffer)
set searchString "Not confirmed"
if {[string match *$searchString* $passwordOption]} {
puts "match found" }\
else {
puts "match not found"
xmlPasswordChange $polName
}
all the puts output and xmlPasswordChange procedure output is not printing in the log file. can you please point out where i am doing wrong.
Thanks for your help in advance.