Posted to tcl by aspect at Thu Jun 30 04:27:30 GMT 2011view raw
- #!/usr/bin/tclsh
- package require Expect
- spawn tclsh ;# my .tclshrc sets up a colour prompt for interactive use
- expect tclsh
- set buf $expect_out(buffer)
- puts "Raw string length: [string length $buf]"
- set str [un_ansi $buf]
- puts "un-ansi'ed string length: [string length $str]"
- puts "actual string: $str"