package require Expect
#### Log File Name #####
set logFile "mtte_result.log"
set NextLine "\n"
set RTSPrompt "RTS_Mon-> "
exp_spawn plink.exe -telnet -P 10009 10.245.97.42
set spid $spawn_id
#exp_send $NextLine
flush stdout
##### Log the session to the File #########
exp_log_file -noappend $logFile
exp_sleep 5
exp_send $NextLine
expect $RTSPrompt
exp_send "hello world\r"
expect $RTSPrompt
exp_sleep 5
exp_close -i $spid
########################################################
########################################################
Here logfile has output as:
RTS_Mon->
*RTS_Mon->
#####################################
so it seems as if input is not forced to the process. Is there something wrong to above script ???