GNU bug report logs - #50025
Strange? grep behaviour

Previous Next

Package: grep;

Reported by: Daniel Forsberg <daniel.forsberg <at> dsv.su.se>

Date: Thu, 12 Aug 2021 15:02:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 50025 <at> debbugs.gnu.org (full text, mbox):

From: Simon Josefsson <simon <at> josefsson.org>
To: Daniel Forsberg <daniel.forsberg <at> dsv.su.se>
Cc: 50025 <at> debbugs.gnu.org
Subject: Re: bug#50025: Strange? grep behaviour
Date: Sun, 15 Aug 2021 16:27:53 +0200
[Message part 1 (text/plain, inline)]
Daniel Forsberg <daniel.forsberg <at> dsv.su.se> writes:

> Hello fellow Grepers!
>
> the following line:
>
> echo -n "9999:egov" | sha256sum | grep -E "[0-9a-f]+" -o | xxd -r -p |
> base32 | grep -E "[0-9A-Z]+" -o
>
> produces the following output
>
> LCBSPBBX6BY6
> VZX6P6TZMMRETTCSPXZU7GJTAPPZCPKF2UJEYDA

This is because W is not part of the Swedish collate class, so A-Z does
not match W, for some strange reason -- I think this has been changed in
recent glibc though.

jas <at> latte:~$ LANG=sv_SE.UTF-8
jas <at> latte:~$ echo -n "9999:egov" | sha256sum | grep -E "[0-9a-f]+" -o | xxd -r -p | base32 | grep -E "[0-9A-Z]+" -o
LCBSPBBX6BY6
VZX6P6TZMMRETTCSPXZU7GJTAPPZCPKF2UJEYDA
jas <at> latte:~$ LANG=C
jas <at> latte:~$ echo -n "9999:egov" | sha256sum | grep -E "[0-9a-f]+" -o | xxd -r -p | base32 | grep -E "[0-9A-Z]+" -o
LCBSPBBX6BY6WVZX6P6TZMMRETTCSPXZU7GJTAPPZCPKF2UJEYDA
jas <at> latte:~$ 

/Simon
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 3 years and 337 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.