Web lists-archives.com

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




On 2018-05-04 16:20, Dmitry Lanin wrote:
> Friday, May 4, 2018, 5:03:32 PM, Michel LaBarre wrote:
>>> On May 4, 2018 4:32 PM Dmitry Lanin wrote:
>>> Bug: grep does not work with [^...]
>>> Run the following command:
>>> echo qwe | grep -E '[^r]'
>>> Expected result:
>>> qwe
>>> Actual result:
>>> -nothing-
>> Run it in bash instead.
>> ^ is a quote character in CMD.
> 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]"

Safer to double it under cmd:
	> echo ^^
	^

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

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