a simple question about grep
    Ben Scott 
    dragonhawk at gmail.com
       
    Thu Sep  6 17:50:58 EDT 2007
    
    
  
On 9/6/07, Kent Johnson <kent37 at tds.net> wrote:
> perhaps this:
>
> egrep -P "^\*(?!INDICATOR)" filename.txt
  Assuming your grep supports the Perl regular expression extensions
(a useful thing to have), that should work.
  Or, if you only have an old grep, but do have Perl, the following should work:
perl -pe '/^\*(?!INDICATOR)/ and print' filename.txt
  Otherwise, I agree with what other suggested, using two grep's in a pipeline.
-- Ben
    
    
More information about the gnhlug-discuss
mailing list