[clug-talk] egrep not working properly under cygwin

Hendrik Schaink hschaink at infovisi.com
Wed Apr 29 15:33:11 PDT 2009


For me these work with regular grep:
$ grep "\-1$" summary.txt
$ grep -v "\-1$" summary.txt

grep _does_ complain about the non-escaped minus mark.

HTH, Hendrik

simon at mungewell.org wrote:
> Not really Linux related, but if someone knows an answer or workaround
> then I would be grateful.
> 
> I'm trying to exclude lines which end in '-1' which fails running under
> cygwin on WinXP. Same commands function OK under Linux.
> 
> Simon.
> --
> $ cat summary.txt | egrep -v -e "-1$" | tail
> 476104.000 51.10411824559 -114.04478800227 3 4
> 476609.000 51.10411831786 -114.04478817894 129 209
> 477003.000 51.10411275090 -114.04479720417 275 -1
> 477169.000 51.10411832040 -114.04478816533 165 169
> 477311.000 51.10411828605 -114.04478819246 3 11
> 477905.000 51.10409428788 -114.04476080702 -1 -1
> 478174.000 51.10411834941 -114.04478804193 62 274
> 478442.000 51.10411833032 -114.04478822637 169 242
> 478521.000 51.10411824799 -114.04478824568 7 21
> 479103.000 51.10413349770 -114.04480034572 -1 -1
> 
> $ which egrep
> /usr/bin/egrep
> 
> $ egrep --version
> GNU grep 2.5.3
> 
> Copyright (C) 1988, 1992-2002, 2004, 2005  Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> --
> 
> 
> _______________________________________________
> clug-talk mailing list
> clug-talk at clug.ca
> http://clug.ca/mailman/listinfo/clug-talk_clug.ca
> Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
> **Please remove these lines when replying

-- 
Hendrik M. Schaink
Chief Consultant

"Integrated Business Solutions with Dependable Service"

InfoVision Consulting
Calgary, Alberta, Canada
Phone: (403) 239-0099



More information about the clug-talk mailing list