Posted to tcl by rmax at Wed Oct 06 09:45:50 GMT 2021view raw

  1. if {$argc == 1} {
  2. for {set i 0} {$i < 10} {incr i} {
  3. puts $i
  4. after 1000
  5. }
  6. } else {
  7. package require Expect
  8. spawn $argv0 x
  9. expect 5 {puts "got five!"}
  10. }
  11.