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*

4
  • 1
    Nice idea, using Awk for two passes. :) If you're going to do that, though, you don't even need to store lines. I decided to post the alternate approach as an answer rather than a comment since the explanation was a bit long. Commented Nov 4, 2016 at 2:32
  • Don, I noticed that for some reason your command is leaving some duplicates. If you run your command and re-direct to a new file the do something like "grep program | awk '{print $6}' | sort | uniq -c | sort -nr | less" you will hopefully see what I'm talking about. Commented Nov 4, 2016 at 16:08
  • record-keeping purposes. You can still see the anomaly when not re-directing its just easier that way for me to verify that there were no duplicates. I did not mean to imply that a re-direct was a possible cause of the results I was seeing. Commented Nov 4, 2016 at 16:32
  • 1
    @user53029 - you do realise I don't have access to your data so I can't replicate whatever happens on your side hence I cannot see any anomaly (I don't see how the solutions above could print duplicate entries anyway - it's impossible "by design" - unless you have duplicate lines like in, entire lines) ? Commented Nov 4, 2016 at 16:38