Posted to tcl by aspect at Thu May 05 07:24:07 GMT 2011view raw
- #!/usr/bin/tclsh
- package require Expect
- spawn sh -c "sleep 10; echo done!"
- fconfigure stdout -buffering none
- expect {
- -timeout 1
- timeout {
- send "."
- puts -nonewline "."
- exp_continue
- }
- eof {
- puts "Finished - got EOF"
- }
- done {
- puts "Finished - got 'done'"
- }
- }