bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50025: Strange? grep behaviour


From: Simon Josefsson
Subject: bug#50025: Strange? grep behaviour
Date: Sun, 15 Aug 2021 16:27:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Daniel Forsberg <daniel.forsberg@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@latte:~$ LANG=sv_SE.UTF-8
jas@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@latte:~$ LANG=C
jas@latte:~$ echo -n "9999:egov" | sha256sum | grep -E "[0-9a-f]+" -o | xxd -r 
-p | base32 | grep -E "[0-9A-Z]+" -o
LCBSPBBX6BY6WVZX6P6TZMMRETTCSPXZU7GJTAPPZCPKF2UJEYDA
jas@latte:~$ 

/Simon

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]