automae telnet and mail check using pine
Hi Guys,
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 :
#!/usr/bin/expect -f
set prompt "(%|#|\\$|>)"
set timeout 10
spawn telnet abcd.com
expect "login: "
send "rajat\n"
expect "Passowrd: "
send "abcd123\n"
expect "{rajat}1:"
send "pine "
---> something has to be done in last line or something has to be added.
Pls help !!! or tell me some alternate method.
Thanks,
Rajat Garg
|