[Tutor] *nix tail -f multiple log files with Thread

Bill Campbell bill at celestial.net
Mon Feb 16 04:09:53 CET 2009


On Sun, Feb 15, 2009, bob gailer wrote:
> David wrote:
>> Hi everyone,
>>
>> I copied a program from C to track multiple log files. I would like to  
>> be able to print a label when a log file is updated.
>
> Did the C program accomplish that? If so, it might help to see that  
> code. If not why mention it?
>

The ``swatch'' program, written in perl, does this by using the
gnu-tail program via a pipe using.

	gtail --follow=name --lines=1 file1 file2 ...

Use the source Luke.

Bill
-- 
INTERNET:   bill at celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:          (206) 236-1676  Mercer Island, WA 98040-0820
Fax:            (206) 232-9186

The day-to-day travails of the IBM programmer are so amusing to most of
us who are fortunate enough never to have been one -- like watching
Charlie Chaplin trying to cook a shoe.


More information about the Tutor mailing list