Posted to tcl by stever at Sat Aug 01 17:16:27 GMT 2009view raw

  1. #!/usr/bin/env tclsh
  2.  
  3. proc main {} {
  4. set fh [open appout.log "CREAT APPEND WRONLY"]
  5. puts $fh [clock seconds]
  6. close $fh
  7. after 1000 [list main]
  8. }
  9.  
  10. set cmdline [lindex $argv 0]
  11. switch $cmdline {
  12. bground {main; vwait forever}
  13. default {exec [file normalize [info script]] bground > /dev/null 2>/dev/null & }
  14. }