#!/usr/local/bin/ruby require 'socket' require 'clipbrd' Port = 4445 host=(if ARGV.length == 1; ARGV.shift; else "localhost"; end) STDERR.print("Trying ", host, " ..."); STDERR.flush sc = TCPsocket.open(host, Port) STDERR.print("connect."); STDERR.flush str = "" #sc.write("HELLO\n") while sc.gets str = str + $_ end sc.close print str Clipboard.SetText("[#{host}]\n"+str)