einpoklum einpoklum - 1 month ago 7
Bash Question

In sed, why can't I use a range of hexdecimal escapes in square brackets?

I'm trying to run:

sed 's/[\xE0-\xEF]/_/g;


but am getting a complaint about an "invalid collation character". What's wrong with my range of characters in the square brackets?

Answer

Try to set the LC_ALL environnement variable to the C locale (aka the POSIX locale):

LC_ALL=C sed 's/[\xE0-\xEF]/_/g'
Comments