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


View this message in rfc822 format

From: Daniel Forsberg <daniel.forsberg <at> dsv.su.se>
To: 50025 <at> debbugs.gnu.org
Subject: bug#50025: Strange? grep behaviour
Date: Thu, 12 Aug 2021 10:27:43 +0200
[Message part 1 (text/plain, inline)]
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

expected output:

LCBSPBBX6BY6WVZX6P6TZMMRETTCSPXZU7GJTAPPZCPKF2UJEYDA

As you can see it removes a single 'W' and replaces it with a new line.

Running Gnu grep 3.6, zsh and Gnome Terminal

uname: Linux 5.13.9-arch1-1 #1 SMP PREEMPT Sun, 08 Aug 2021 11:25:35
+0000 x86_64 GNU/Linux

Tried bash as well with same result.

On macOs i get the expected result, a colleague running the same base os
on similar hwconfig computer but other device but with XFCE terminal
also gets expected result so this seems to be something particular to my
system but I have not been able to find why.

Everything looks the same up till the last grep. If I change the regexp
to \w+ I get the expected output.

Honestly, dont know if this is a bug or just something iffy on my device
but thought it might be better to contact you anyways to see if you can
reproduce this in any way



-- 
____________________________________
*Daniel Forsberg*
Developer at eGovlab

Department of Computer and Systems Sciences
*Stockholm University*
Postbox 7003, SE-164 07 Kista
Visiting address: Borgarfjordsgatan 12, Kista
https://egovlab.eu/
https://dsv.su.se
____________________________________
[Message part 2 (text/html, inline)]
[OpenPGP_signature (application/pgp-signature, attachment)]

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.