Re: netcat in listen mode don't exit

2009-02-13 Thread Eric Gerlach
On Fri, Feb 13, 2009 at 07:26:50AM -0300, Paulo Brito wrote: > > > > If you want to just what's changed in the log file since the last time > > you connected, look at the package logtail. > > > > For example you might run this command: > > > > while :; do nc -l -p 5558 -c "logtail /var/log/syslog";

Re: netcat in listen mode don't exit

2009-02-13 Thread Paulo Brito
> > If you want to just what's changed in the log file since the last time > you connected, look at the package logtail. > > For example you might run this command: > > while :; do nc -l -p 5558 -c "logtail /var/log/syslog"; done > > This would have nc exit when it's done dumping /var/log/syslog an

Re: netcat in listen mode don't exit

2009-02-12 Thread Tod Detre
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paulo Brito wrote: > Thanks for de tips about top posting. I"ll remember > > Michael, -w option dont make nc returns if a conection is already > stablished. > > I've tried this: nc -l -p 5558 -c bash. And it works! I think the big > probleam is that

Re: netcat in listen mode don't exit

2009-02-11 Thread Paulo Brito
2009/2/11 Michael Iatrou > When the date was Wednesday 11 February 2009, Paulo Brito wrote: > > > 2009/2/11 Michael Iatrou > > > > > When the date was Wednesday 11 February 2009, Paulo Brito wrote: > > > > I"m trying to setup netcat so it serves logs to other systems. When > > > > a client conn

Re: netcat in listen mode don't exit

2009-02-11 Thread Michael Iatrou
When the date was Wednesday 11 February 2009, Paulo Brito wrote: > 2009/2/11 Michael Iatrou > > > When the date was Wednesday 11 February 2009, Paulo Brito wrote: > > > I"m trying to setup netcat so it serves logs to other systems. When > > > a client connects, the server starts to send some log

Re: netcat in listen mode don't exit

2009-02-11 Thread Paulo Brito
It should, but it doesn't. It only made diference when there's no connection. When a connection is made, even with -w 5 (for instance), nc waits forever. 2009/2/11 Sudev Barar > 2009/2/12 Paulo Brito : > > Michael, thanks for your reply. But if you read my entire email, you'll > see > > that the

Re: netcat in listen mode don't exit

2009-02-11 Thread Paulo Brito
Michael, thanks for your reply. But if you read my entire email, you'll see that the problem is netcat NOT exiting after disconnect. So, your script will not solve the problem, because the nc never exits. Thanks anyway. 2009/2/11 Michael Iatrou > When the date was Wednesday 11 February 2009, Pa

Re: netcat in listen mode don't exit

2009-02-11 Thread Michael Iatrou
When the date was Wednesday 11 February 2009, Paulo Brito wrote: > I"m trying to setup netcat so it serves logs to other systems. When a > client connects, the server starts to send some logs. > > I run netcat in listem mode like this: > > # nc -l -p 5558 -c "tail -f /var/log/syslog" while :; do

netcat in listen mode don't exit

2009-02-11 Thread Paulo Brito
I"m trying to setup netcat so it serves logs to other systems. When a client connects, the server starts to send some logs. I run netcat in listem mode like this: # nc -l -p 5558 -c "tail -f /var/log/syslog" the client I run like this: # nc 5558 The problem is that the server keeps running w