Subject: bug#39368: Possible visualization bug in GNU grep 3.1 (Ubuntu 18.04 x86_64)

From: "Paul Jackson" <[email-masked]>
Date: Fri, 31 Jan 2020 07:54:03 -0600

You wrote:

==========
#> grep -v "Position\|hand type\|^\t\t$" ArticulationsOrder.txt | grep
'[^A-Z]' # outputs just endlines
==========

When I downloaded your attached file, and converted the above
command to the following single, non-wrapped line (as I presume
you intended):

grep -v "Position\|hand type\|^\t\t$" ArticulationsOrder.txt | grep '[^A-Z]'

then I do NOT get just endlines. 

Rather I get the same useful output that you reported getting when
piping this output through "more".

_However_, in either case, each output line ends in a carriage
return '\r', which I suspect is the key to the problem you report.

Try the following:

    echo 'abc\r' 
    echo 'xyz\r' | more

When I do that, I see both the "abc" and the "xyz"

I'm guessing you'll see just a blank line and the "xyz".

Then, for your ArticulationsOrder.txt data, try the following command,
which may (I'm guessing wildly) work better for your purposes:

grep -E -v 'hand type|Position' ArticulationsOrder.txt | tr -d '\r' 

That second grep, the "grep '[^A-Z]'", does nothing that I can see,
on your data, since every line has at least one character that is
not an [A-Z] upper case letter, so every line matches that pattern.

I would suggest that using "grep -E" (or "egrep") is clearer
than using "grep" and escaping the '|' symbols.

-- 
                Paul Jackson
                [email-masked]