Web lists-archives.com

Re: grep does not work with [^...]




Hello Michel,

Thank you.
Yes, I guessed it is a special character, so I tried (did not work):
echo qwe | grep -E '[\^r]'

I have finally figured out. Using double-quotes work:
echo qwe | grep -E "[^r]"

Kind regards,
Dmitry

Friday, May 4, 2018, 5:03:32 PM, you wrote:

ML> Run it in bash instead.
ML> ^ is a quote character in CMD.

>> -----Original Message-----
>> From: cygwin-owner@xxxxxxxxxx [mailto:cygwin-owner@xxxxxxxxxx] On
>> Behalf Of Dmitry Lanin
>> Sent: May 4, 2018 4:32 PM
>> To: cygwin@xxxxxxxxxx
>> Subject: Bug: grep does not work with [^...]
>> 
>> Bug: grep does not work with [^...]
>> 
>> Run the following command:
>> echo qwe | grep -E '[^r]'
>> 
>> Expected result:
>> qwe
>> 
>> Actual result:
>> -nothing-
>> 
>> -----------------------------------
>> cygwin DLL version: 2.10.0
>> base-cygwin          3.8-1
>> bash                 4.4.12-3
>> coreutils            8.26-2
>> cygutils             1.4.16-2
>> cygwin               2.10.0-1
>> grep                 3.0-2
>> -----------------------------------
>> 
>> Kind regards,
>> Dmitry
>> 
>> 
>> --
>> Problem reports:       http://cygwin.com/problems.html
>> FAQ:                   http://cygwin.com/faq/
>> Documentation:         http://cygwin.com/docs.html
>> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple




-- 
Best regards,
 Dmitry                            mailto:jjj17@xxxxxxxxx


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple