> tac somefile | awk '/pattern/ { print; exit }'
> tac somefile | perl -ne 'print, exit if /pattern/'


*Almost* there! (quote)

So, I use:

   tac /var/log/messages* | awk '/Connect:/ { print; exit }'


Which returns:

   [root@coltrane /root]# tac /var/log/messages* | awk '/Connect:/ { print;
exit }'
   May  6 15:37:14 localhost pppd[10926]: Connect: ppp0 <--> /dev/ttyS0
   Broken pipe

   [root@coltrane /root]#


I've tried throwing in a 2> /dev/null at the end, but that makes it *only*
return the broken pipe message.

the tac returns much more than awk needs, so I'm assuming that's why it
happens. Awk decides to stop, hving the info it wanted, and tac is sitting
there trying to pipe to something non-existent. Understandable, but I've no
idea how to stop it...


Still, it tells me what I need to know, and I've learned something doing it!
:)

- Jeff


-- [EMAIL PROTECTED] -------------------------------------------------

   w: http://advogato.org/person/jdub/
   i: 16341281 (jdub!)
   q: "make: *** No rule to make target `whoopee'.  Stop."



--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to