[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 'watching' a file



   hmmm.. if 'tail -f filename' continuously outputs using stdout, how could
   I stop it when the text I'm looking for appears?  I want tail to terminate
   when it receives the following information: 

	   caller=##########, conn='', name='username'

   ..and put those strings in variables for another program to use.

Something along the lines of:

tail -f /var/log/mgetty/mg_ttyS1.log | perl -ne 'if (/^caller=/)
{ print; exit 0; }' 

could get you the raw data; then you could postprocess this data
however you want.

(This is completely theoretical; i.e., I haven't tested it.)


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: