home *** CD-ROM | disk | FTP | other *** search
- #!tcl
-
- #
- # IDENT Client - useful for testing
- #
-
- if {$argc != 3} {
- error {Usage: ident address src dst}
- }
-
- set addr [lindex $argv 0]
- set src [lindex $argv 1]
- set dst [lindex $argv 2]
-
- set cs [socket $addr 113]
-
- if {[lindex $cs 0] == "can't"} {
- error "Connect failed"
- }
-
- # send the request
-
- $cs puts "$src, $dst\n"
-
- # read the response
-
- set data [$cs gets 512]
- echo $data
-
- # close the socket
-
- rename $cs {}
-