On Thu, Feb 6, 2014 at 2:22 PM, Vegard Lima <[email protected]> wrote: > On Thu, Feb 6, 2014 at 2:07 PM, Volker Braun <[email protected]> wrote: >> This works for me on Fedora 20. Something must be wrong with your sed. What >> do you get for ... >> $ echo 5b5e732cd1eaa01bcfa2b47903ce6ea041a0fae3 | sed 's/[^0-9a-f].*//' >> 5b5e732cd1eaa01bcfa2b47903ce6ea041a0fae3 > > Same sed version. Found the culprit: > > $ echo $LC_COLLATE > nn_NO.utf8 > $ echo 5b5e732cd1eaa01bcfa2b47903ce6ea041a0fae3 | sed 's/[^0-9a-f].*//' > 5b5e732cd1e
This behaviour is apparently known: http://teaching.idallen.com/net2003/06w/notes/character_sets.txt A safe alternative that should work independently of LC_COLLATE is this: $ echo 5b5e732cd1eaa01bcfa2b47903ce6ea041a0fae3 | sed 's/[^[:xdigit:]].*//' (see http://www.regular-expressions.info/posixbrackets.html) Thanks, -- Vegard -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
