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.

2
  • 1
    grep doesn't care if the lines are sorted; if you can show evidence of different behavior, that'd be good for a separate question (new questions don't go in Answers) Commented Jun 12, 2018 at 11:23
  • 1
    grep does not create a file. When you use redirection, the shell creates the file. So the file name cannot possibly have anything to do with the options you pass to grep. If editing the file fixed it, maybe there was a non-ASCII character or a control character somewhere and you removed it without noticing. But without seeing your exact source, that's just speculation. Commented Jun 12, 2018 at 19:16