Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Tailing a file to a TCP socket

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


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
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2022-08-08 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?