Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 06-24-2004, 11:37 AM   #1
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
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.

Rajat Garg


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 11:07 AM
[Expect scripting] send problem ldp Programming 1 01-24-2005 02:39 PM
trying to execute an expect script in .bashrc smaudlin Red Hat 2 01-02-2005 01:34 AM
CGI script problem: Send/Expect command echo on webpage rajatgarg Programming 2 07-11-2004 04:38 PM
automae telnet and mail check using pine rajatgarg Programming 2 06-25-2004 12:25 AM > Forums > Linux Forums > Linux - Networking

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

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