title: Remove duplicate lines without sorting
body: <p>I have a utility script in Python:</p>
  
  <pre><code>#!/usr/bin/env python
  import sys
  unique_lines = []
  duplicate_lines = []
  for line in sys.stdin:
    if line in unique_lines:
      duplicate_lines.append(line)
    else:
      unique_lines.append(line)
      sys.stdout.write(line)
  # optionally do something with duplicate_lines
  </code></pre>
  
  <p>This simple functionality (<code>uniq</code> without needing to sort first, stable ordering) must be available as a simple UNIX utility, mustn't it? Maybe a combination of filters in a pipe?</p>
  
  <p>Reason for asking: needing this functionality on a system on which I cannot execute Python from anywhere.</p>