[NTLUG:Discuss] in a world where grep doesn't have the -m (match) option..

Richard ntlug at rain4us.net
Tue Mar 25 16:25:54 CDT 2008


Chris Cox wrote:
> Richard wrote:
>   
>> ..how would one go about stopping a grep after the first match? <snippage>
> <snippage>
>
> grep 'whatever' file | head -1
> (that's a minus one)
>   
AH YES!!  That's brilliant!   It would cause the search to continue..but 
WOULD get the job done.  Thanks Chris!

-- 
Richard



More information about the Discuss mailing list