LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 06-24-2004, 12:37 PM   #1
rajatgarg
Member
 
Registered: Oct 2003
Posts: 41

Rep: Reputation: 15
Automae telnet log in and execute commands (expect and send)


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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
telnet server not reliable for expect script powah Linux - Software 0 11-16-2005 12:07 PM
[Expect scripting] send problem ldp Programming 1 01-24-2005 03:39 PM
trying to execute an expect script in .bashrc smaudlin Red Hat 2 01-02-2005 02:34 AM
CGI script problem: Send/Expect command echo on webpage rajatgarg Programming 2 07-11-2004 05:38 PM
automae telnet and mail check using pine rajatgarg Programming 2 06-25-2004 01:25 AM


All times are GMT -5. The time now is 11:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration