I'm trying to match against some UTF-8 characters.
The problem is grep
doesn't translate \x
byte escapes, so
this fails:
echo -e '\xd8\xaa' | grep -P '\xd8\xaa'
while this succeeds:
echo -e '\xd8\xaa' | grep -P $(printf '\xd8\xaa')
Can grep understand byte escapes directly without using printf? How?
Best Answer
This fails:
This succeeds:
Documentation
From
man bash
: