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

#!/bin/sh
# \
exec tclsh "$0" ${1+"$@"}
 
socket -server serve 4321

proc serve {sock host port} {
    set fd [open /tmp/random.txt rb]
    chan copy $fd $sock
    close $fd
}

vwait forever