Automae telnet log in and execute commands (expect and send)
I am using expect and send to write a script to automate telnet and executig pine.
Problem is that as soon as I execute pine, script exits and kills the child process and makes pine unaccessible.
I am trying to write a script that can remotely login to server, execute pine and I can use pine till the end of day (without exiting). I dont want to downlaod the mail from server or run the script again at again.
here is the sample script that works until loggin in remote machine :
set prompt "(%|#|\\$|> )"
set timeout 10
spawn telnet abcd.com
expect "login: "
expect "Passowrd: "
send "pine "
---> something has to be done in last line or something has to be added.
Pls help !!! or tell me some alternate method.