![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Capturing Sybase SP output in Shell Script | rajpreetsidhu | Shell Programming and Scripting | 2 | 08-19-2009 08:50 AM |
| capturing output from top and format output | new2ss | Shell Programming and Scripting | 4 | 02-24-2009 09:26 PM |
| capturing line from script output and appending to a file | wally_welder | Shell Programming and Scripting | 6 | 08-31-2007 03:03 AM |
| Capturing shell script command output | designflaw | Shell Programming and Scripting | 2 | 03-01-2006 04:24 PM |
| capturing output in script | MizzGail | Shell Programming and Scripting | 6 | 06-02-2004 07:44 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Problem capturing output in TCL script
I have a TCL script that logs into a switch using expect.I send a command "show port-security address" and it returns a table having a large number of rows.I need to capture this output(the table) and store it in a .txt file.
I have done this: Code:
match_max 5000
set expect_out(buffer) {}
set logfile_id [open "log.txt" w]
...#code for logging in
send -i $con_id "terminal length 0\r"
expect -i $con_id -re {#}
send -i $con_id "show port-security address\r "
expect -i $con_id -re {#}
puts $logfile_id $expect_out(buffer)
flush $logfile_id
close $logfile_id
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|