Posted to tcl by aspect at Thu May 05 07:24:07 GMT 2011view raw

  1. #!/usr/bin/tclsh
  2. package require Expect
  3. spawn sh -c "sleep 10; echo done!"
  4. fconfigure stdout -buffering none
  5. expect {
  6. -timeout 1
  7. timeout {
  8. send "."
  9. puts -nonewline "."
  10. exp_continue
  11. }
  12. eof {
  13. puts "Finished - got EOF"
  14. }
  15. done {
  16. puts "Finished - got 'done'"
  17. }
  18. }
  19.