emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#24961: closed (input option -z alters behavior of


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#24961: closed (input option -z alters behavior of output option -o in an undocumented way)
Date: Sat, 19 Nov 2016 10:02:02 +0000

Your message dated Sat, 19 Nov 2016 02:00:50 -0800
with message-id <address@hidden>
and subject line Re: bug#24961: input option -z alters behavior of output 
option -o in an undocumented way
has caused the debbugs.gnu.org bug report #24961,
regarding input option -z alters behavior of output option -o in an 
undocumented way
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
24961: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24961
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: input option -z alters behavior of output option -o in an undocumented way Date: Fri, 18 Nov 2016 00:16:19 -0600
This bug report concerns GNU grep 2.25.

Consider this file:

$ cat test
one lone
long
tone

"grep -o", according to the man page and info file, outputs "each [matched] 
part on a separate output line."  Given that, this command gives the expected 
output:

$ grep -o one test
one
one
one

The documentation also states that -z affects only how input is interpreted.  
However, adding -z makes -o no longer obey the above-quoted documentation line:

$ grep -zo one test
oneoneone

Hexdump shows that this output has ASCII NULs in place of newlines:

$ grep -zo one test | hexdump -C
00000000  6f 6e 65 00 6f 6e 65 00  6f 6e 65 00              |one.one.one.|
0000000c

Thus, -z changes the line separator used by -o.  This might or might not be 
desired behavior, but it is certainly not behavior that the documentation leads 
one to expect.  In other words, I don't know whether this is a software bug or 
a documentation bug, only that the two don't agree.



--- End Message ---
--- Begin Message --- Subject: Re: bug#24961: input option -z alters behavior of output option -o in an undocumented way Date: Sat, 19 Nov 2016 02:00:50 -0800 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0
address@hidden wrote:
The documentation also states that -z affects only how input is interpreted.

I don't see where it does that, as the current documentation for -z talks about both "input and output data". That being said, the manual could be clearer. I installed the attached.

Attachment: 0001-grep-document-oz-better.patch
Description: Text Data


--- End Message ---

reply via email to

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