einpoklum einpoklum - 1 year ago 107
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 Source

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

LC_ALL=C sed 's/[\xE0-\xEF]/_/g'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download