Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • I think what has to be going on is that the line ending character of the file input.txt is not being recognized as such. I'm not sure why else grep [A-Z] input.txt would match every line of input.txt. How was input.txt created? What happens if you try to match another line, say `grep a input.txt'? Does that also match every line of input.txt? Commented Jan 18, 2017 at 21:52
  • 1
    grep 2.6.3 is pretty old. Can you try with a newer version so as to discriminate between a (already fixed) bug in grep, and a legitimate functioning due to specificities of your environment? Commented Jan 18, 2017 at 22:12
  • It was created with cat > input.txt and I typed into the terminal. Commented Jan 18, 2017 at 23:09
  • 1
    Well the Bug fixes section of the NEWS file for GNU grep 2.8 rather cryptically notes that "grep's interpretation of range expression is now more consistent with that of other tools. [bug present since multi-byte character set support was introduced in 2.5.2, though the steps needed to reproduce it changed in grep-2.6]" - maybe that gives you a lead? Commented Jan 19, 2017 at 0:05
  • 1
    It is also fixed in 2.7, the next release after 2.6.3 Commented Jan 19, 2017 at 0:35