[TriLUG] expect - getting closer

Greg Brown gwbrown1 at gmail.com
Mon Mar 9 15:35:21 EDT 2009


$expect_out(buffer) just isn't writing what I think it should

Here's the code snippet in question:

# prompt change
expect "*#"

#issue the 'show run'
send "show run\r"

expect "#"

# write that output to the log file
# test line 1
set dataiwant $expect_out(buffer)
puts $log $dataiwant
puts $log "Hello World\n"


The output file writes the hostname# prompt but not the results of 'show
run'.  I'm about ready to abandon expect only and go running back to
perl-expect.

Greg



More information about the TriLUG mailing list