[plug] tail -f

Onno Benschop onno at itmaze.com.au
Fri Aug 12 09:44:12 WST 2005


Russell Steicke wrote:

>On Fri, Aug 12, 2005 at 10:53:16AM +0930, Onno Benschop wrote:
>  
>
>>Hi folks,
>>
>>I'm trying to come up with a way that I can watch the tail of a log file 
>>until a certain string occurs, then I want to stop watching. (The 
>>functionality is to prod fetchmail and watch until the sleeping message 
>>comes past.)
>>
>>Anyone got any bright ideas?
>>    
>>
>
>awk
>
>tail -F file | awk '{print;} /string/{exit;}'
>
Thanks for the really quick response, but it's not working as I 
expected, this just sits there:

sudo /etc/init.d/fetchmail awaken && tail -n0 -f /var/log/syslog | grep 
fetch | awk '{print;} /sleeping/{exit;}'


-- 
Onno Benschop

Connected via Optus B3 at S34°45'36.5" - E139°00'08.7" (Mount Pleasant, SA)
--
()/)/)()        ..ASCII for Onno..
|>>?            ..EBCDIC for Onno..
--- -. -. ---   ..Morse for Onno..

Proudly supported by Skipper Trucks, Highway1, Concept AV, Sony Central, Dalcon
ITmaze   -   ABN: 56 178 057 063   -  ph: 04 1219 8888   -   onno at itmaze.com.au





More information about the plug mailing list