Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Syntactic Confectionery Delight
 
PerlMonks  

Re: Tailing a file to a TCP socket

by IndyZ (Friar)
on Aug 01, 2001 at 18:40 UTC ( [id://101476]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Tailing a file to a TCP socket

Here's how I like to do it. You need to have the always versatile netcat program installed (http://www.l0pht.com/~weld/netcat/), and the "tail" utility, which is included in Cygwin and other bundles of Unix commands for Windows (I can't remember where mine came from). On the receiving Unix box, run
nc -l -p 2000
On the Windows box, run
tail -f c:\logfile.txt | nc unixbox 2000
Replace 2000 with the port number that you want to use, and unixbox with the actual address of the Unix box.

I know, this doesn't use Perl, but it does everything that your example script did, and with only two lines of "code." Plus, you get to use netcat, which has tons of other uses, and no sysadmin should be without it.

--
IndyZ

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://101476]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.