#!/bin/sh
# Restart with tclsh \
exec tclsh "$0" "$@"

package require comm 4.2
namespace import comm::comm

proc main {{host localhost} {port 1777} args} {
    set id [list $port localhost]
    comm connect $id

    while {1} {
        set data [gets stdin]
        if {[eof stdin]} {
            break
        }

        puts [comm send $id [list string toupper $data]]
    }
}

main {expand}$argv

# vim: set ts=4 sts=4 sw=4 tw=80 et:

