LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-17-2007, 11:28 AM   #1
flhrc
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
expect and openssh


Hi, All;
I am trying to automate some tasks for a large number of network devices (switches). The devices act as ssh servers. When I use openssh client to connect interactively with these devices, all is well.
When I try to use expect for the interaction, the log on sequence is successful. Then, when I issue the desired command with expect it appears that the switch does not like the line terminator because it echoes the command but does not execute it (I had to disable speudo-tty allocation to get this far).
It seems that expect should be sending the same information that the keyboard would send during an interactive session, but apparently not.
Any suggestions?

p.s.: I am running Slackware 12.0.
 
Old 12-17-2007, 12:53 PM   #2
WolfAngel
LQ Newbie
 
Registered: Oct 2007
Posts: 1

Rep: Reputation: 0
I think I once did something similar, but I did it with a shell script, and telnet, but it shouldn't be impossible though.
What I did was, making the shell script echo my commands, I just piped it into telnet, like ./shellscript.sh | telnet
Worked like a charm.

You could then make a list of ip/hostnames, and do a for a in `cat list`; do ./shellscript.sh| telnet $a done;

But I'm not sure that's what you're looking for?

Last edited by WolfAngel; 12-18-2007 at 01:18 AM.
 
  


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
How to use expect TomCruise2002 Linux - General 2 04-09-2017 08:00 AM
About Expect shan_nathan Programming 2 09-25-2007 09:29 PM
expect newbie_adm Linux - Newbie 1 06-07-2006 01:23 AM
expect - any other way? rooksin Programming 1 03-09-2006 10:26 PM
Expect how to? e-freak Programming 2 09-24-2005 04:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:37 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
Open Source Consulting | Domain Registration