Dear grep maintainers,
I think I've found a file that makes grep display wrong things, namely endlines when grep is run "alone", piping just two greps together vs. text when the output is piped e.g. to more or hd (hexdump).
The offending command is this one:
#> grep -v "Position\|hand type\|^\t\t$" ArticulationsOrder.txt | grep '[^A-Z]' # outputs just endlines
While:
#> grep -v "Position\|hand type\|^\t\t$" ArticulationsOrder.txt | grep '[^A-Z]' | more # outputs this lines
METACARPAL ="(63.1641, 111.558, 103.153)"
PROXIMAL ="(63.1641, 111.558, 103.153)"
INTERMEDIATE ="(32.0933, 130.062, 69.1525)"
DISTAL" ="(21.6896, 137.526, 37.7594)"
METACARPAL ="(63.1641, 111.558, 103.153)"
PROXIMAL ="(63.1641, 111.558, 103.153)"
INTERMEDIATE ="(32.0933, 130.062, 69.1525)"
DISTAL" ="(21.6896, 137.526, 37.7594)"
METACARPAL ="(63.1641, 111.558, 103.153)"
PROXIMAL ="(63.1641, 111.558, 103.153)"
INTERMEDIATE ="(32.0933, 130.062, 69.1525)"
DISTAL" ="(21.6896, 137.526, 37.7594)"
METACARPAL ="(63.1641, 111.558, 103.153)"
PROXIMAL ="(63.1641, 111.558, 103.153)"
INTERMEDIATE ="(32.0933, 130.062, 69.1525)"
DISTAL" ="(21.6896, 137.526, 37.7594)"
METACARPAL ="(63.1641, 111.558, 103.153)"
PROXIMAL ="(63.1641, 111.558, 103.153)"
INTERMEDIATE ="(32.0933, 130.062, 69.1525)"
DISTAL" ="(21.6896, 137.526, 37.7594)"
METACARPAL ="(63.1641, 111.558, 103.153)"
PROXIMAL ="(63.1641, 111.558, 103.153)"
INTERMEDIATE ="(32.0933, 130.062, 69.1525)"
DISTAL" ="(21.6896, 137.526, 37.7594)"
METACARPAL ="(63.1641, 111.558, 103.153)"
PROXIMAL ="(63.1641, 111.558, 103.153)"
INTERMEDIATE ="(32.0933, 130.062, 69.1525)"
DISTAL" ="(21.6896, 137.526, 37.7594)"
METACARPAL ="(63.1641, 111.558, 103.153)"
PROXIMAL ="(63.1641, 111.558, 103.153)"
INTERMEDIATE ="(32.0933, 130.062, 69.1525)"
DISTAL" ="(21.6896, 137.526, 37.7594)"
METACARPAL ="(63.1641, 111.558, 103.153)"
PROXIMAL ="(63.1641, 111.558, 103.153)"
INTERMEDIATE ="(32.0933, 130.062, 69.1525)"
DISTAL" ="(21.6896, 137.526, 37.7594)"
METACARPAL ="(63.1641, 111.558, 103.153)"
PROXIMAL ="(63.1641, 111.558, 103.153)"
INTERMEDIATE ="(32.0933, 130.062, 69.1525)"
DISTAL" ="(21.6896, 137.526, 37.7594)"
I can reproduce this also on my Raspberry Pi 4 (with Ubuntu 18.04 and grep v3.1 as well) and another x86_64 node with Xeon Silver belonging to a research cluster (grep v2.20).
If you have any questions, do not hesitate to contact me. Thanks for all the work you do.
Best regards
Andrea Ranieri
#> grep --version
grep (GNU grep) 3.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
#> uname -a
Linux zapp-brannigan 5.3.0-24-generic #26~18.04.2-Ubuntu SMP Tue Nov 26 12:34:22 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
#> alias | grep grep
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
--
Andrea Ranieri, Ph.D.
Researcher
National Research Council of Italy