Subject: bug#36820: closed (Re: bug#36820: grep "[[:cntrl:]]" /proc/1/cmdline works on 2.20 but not 3.3)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 27 Jul 2019 17:17:04 +0000

Your bug report

#36820: grep "[[:cntrl:]]" /proc/1/cmdline works on 2.20 but not 3.3

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
36820: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36820
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#36820: grep "[[:cntrl:]]" /proc/1/cmdline works on 2.20 but not 3.3
From: Paul Eggert <[email-masked]>
To: Jeff Chua <[email-masked]>, [email-masked]
Date: Sat, 27 Jul 2019 10:16:00 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

This is documented behavior; the grep manual says that when grep is reading a 
binary file it "may treat non-text bytes as line terminators".

You can use grep's -a (--text) option to if you want to match null bytes.

Subject: grep "[[:cntrl:]]" /proc/1/cmdline works on 2.20 but not 3.3
From: Jeff Chua <[email-masked]>
To: [email-masked]
Date: Sat, 27 Jul 2019 07:52:37 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

# using grep 2.20 ...
# grep "[[:cntrl:]]" /proc/1/cmdline
Binary file /proc/1/cmdline matches

# using grep 3.3 or above 2.20 ...
# grep "[[:cntrl:]]" /proc/1/cmdline
... nothing returned

My best.,
Jeff