LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-30-2008, 06:06 AM   #1
eentonig
LQ Newbie
 
Registered: Jan 2008
Posts: 26

Rep: Reputation: 15
expect_out(buffer) is not capturing all output from a Cisco IOS command


Probably I'm overseeing something obvious. But I can't get it to work.

I'm trying to create an Expect script that will capture the output from certain Cisco IOS commands and log them in a text file. Everything works fine, apart from the expect_out() output.

I've been searching for two days now, and thought it might be time to pop the question.

I've already tried changing the match_max value, but this doesn't seem to work.

Here's a snippet from the script
Code:
...
set IfIndex      "show ip interfaces brief\r"
set termlength   "terminal length 0\r"
send \r
send $termlength 
expect {*#}     {}
send $IfIndex
expect {*#}     {}
set outcome $expect_out(buffer)
puts $outcome
...
And this is all I get as outcome, while I would expect several lines off text.

Quote:

tntunr1-vpn#
Can somebody point me to where I make my mistake.
 
Old 01-30-2008, 07:29 AM   #2
eentonig
LQ Newbie
 
Registered: Jan 2008
Posts: 26

Original Poster
Rep: Reputation: 15
Angry

Never mind. It appears I made a stupid typo in the cisco command I'm sending.

Should have read "show ip interface brief" and not "interfaces"
 
  


Reply

Tags
expect, script


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
linux CISCO IOS emulator? tekhead2 Linux - Software 2 04-22-2008 03:49 AM
cisco IOS replacement? alabamaman Linux - Networking 1 08-17-2007 02:38 AM
Cisco IOS graciejj_82 Linux - Networking 2 08-01-2006 07:42 AM
IOS cisco emulator gabsik Linux - Software 1 06-07-2006 06:13 PM
Cisco 871 Router IOS anubis65656 Linux - Networking 1 02-23-2006 11:19 AM


All times are GMT -5. The time now is 08:41 PM.

Main Menu
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