Skip to content

Instantly share code, notes, and snippets.

@zmwangx
Created July 1, 2014 18:16
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zmwangx/9bf88fddc12297cf8611 to your computer and use it in GitHub Desktop.
Save zmwangx/9bf88fddc12297cf8611 to your computer and use it in GitHub Desktop.
Shell script: unsorted uniq via awk (uniq without sorting first).
#!/bin/bash
# remove duplicates without pre-sorting
# `uuniq' stands for unsorted uniq
awk '!x[$0]++'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment