Bernhard Voelker wrote:
On 02/02/2018 09:29 PM, Linda Walsh wrote:
I've used grep to search for strings across all my mailboxes for decades. Found out today, it randomly doesn't work based on whether or not the file contains any text that doesn't comply with POSIX.
So if one user has UTF-8 encoding and another, ISO-8859-1, and they are in the same mailbox, according to POSIX, that's a binary file.
yes, IMO Eric Blake explained that quite well: https://lists.gnu.org/r/bug-grep/2018-02/msg00001.html
You have to tell grep to search (and potentially display) binary data [...].
I don't think so - but you have to tell it to process the file single-byte-wise
If data is in processed as "binary", wouldn't that mean processing it with no encoding or decoding -- as a stream of bytes? How do you interpret binary?
locale (which is impossible in that case). Again, Eric showed you the way: $ LC_ALL=C grep ...
Wouldn't LC_CTYPE suffice if you went that route? However, since you say it would be impossible to process the file as some encoding, then instead of throwing some error, or skipping the file, wouldn't it be more useful to default to such processing upon encountering a file that might appear "binary" (as in my case: "Non-ISO extended-ASCII text, with very long lines") in the case that "POSIXLY_CORRECT" was not set?
Note the last line is the prompt same text as you can see at top of window.
I don't see what "head -3 /bin/bash" has to do with the output of grep or your $SUBJECT at all (apart from the term "binary").
It was showing the output of a real binary file instead of an "mbox" that would contain multiple encodings and why one still doesn't want unrestrained display of binary, even if one wants to process text with multiple or incorrect encodings. The original example had: 'grep -a string /bin/bash|head -3', but for purposes of showing tty-corruption, the "head -3 /bin/bash" was sufficient. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org