Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 01-30-2008, 06:06 AM   #1
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
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.


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

Original Poster
Rep: Reputation: 15

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"


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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:57 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