cvs commit: src/usr.bin/tail extern.h forward.c tail.c

Paul Richards paul at originative.co.uk
Thu Nov 4 14:42:29 PST 2004


On Thu, 2004-11-04 at 20:08, Sam Leffler wrote:
> On Thursday 04 November 2004 11:18 am, Paul Richards wrote:
> > paul        2004-11-04 19:18:19 UTC
> >
> >   FreeBSD src repository
> >
> >   Modified files:
> >     usr.bin/tail         extern.h forward.c tail.c
> >   Log:
> >   Add support for following more than one file i.e.
> >   tail -f file1 file2
> >
> >   Revision  Changes    Path
> >   1.9       +10 -1     src/usr.bin/tail/extern.h
> > http://cvsweb.FreeBSD.org/src/usr.bin/tail/extern.h.diff?r1=1.8&r2=1.9
> >   1.35      +160 -88   src/usr.bin/tail/forward.c
> > http://cvsweb.FreeBSD.org/src/usr.bin/tail/forward.c.diff?r1=1.34&r2=1.35
> >   1.18      +30 -7     src/usr.bin/tail/tail.c
> > http://cvsweb.FreeBSD.org/src/usr.bin/tail/tail.c.diff?r1=1.17&r2=1.18
> 
> Why is this better than
> 
> tail -f file1&
> tail -f file2
> 
>  Sam

A few reasons.

Main one is that it's a single process. If you debug webservers a lot
you'd like to be able to do:

vi httpd.conf
apachectl restart; tail -f errors access
ctrl C

and then start the cycle again.

With your suggestion it's a bit of a pain to also have to kill the
background job which has a habit of spitting out output when you really
don't want it.

It's more efficient, though that's a marginal argument :-)

You can do things like

find /weservers/logs -name access |xargs tail -f

So, on the whole I think it provides some useful new functionality.

Paul.



More information about the cvs-src mailing list