On Mon, 8 May 2000, Jeff Waugh wrote:

> > Try "tac ...." (reverse cat)
> 
> 
> You know what? I actually tried perg, and didn't even think about tac. Talk
> about having the obvious stick in your eye... (cue Adrian's victorious
> chuckle)
> 
> Alrighty, well that gets me my logs the right way around, but the second
> question remins:
> 
> How do I get just the first match without waiting for head to return (and
> telling me I have a broken pipe as well)?

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

--
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