Posted to tcl by aspect at Fri Apr 19 22:38:56 GMT 2024view raw

  1. #!/bin/sh
  2. # \
  3. exec tclsh "$0" ${1+"$@"}
  4.  
  5. socket -server serve 4321
  6.  
  7. proc serve {sock host port} {
  8. set fd [open /tmp/random.txt rb]
  9. chan copy $fd $sock
  10. close $fd
  11. }
  12.  
  13. vwait forever
  14.