Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-17-2007, 12:28 PM   #1
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, 01:53 PM   #2
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 ./ | telnet
Worked like a charm.

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

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

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


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 09:00 AM
About Expect shan_nathan Programming 2 09-25-2007 10:29 PM
expect newbie_adm Linux - Newbie 1 06-07-2006 02:23 AM
expect - any other way? rooksin Programming 1 03-09-2006 11:26 PM
Expect how to? e-freak Programming 2 09-24-2005 05:49 AM > Forums > Linux Forums > Linux - Newbie

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