Skip to content

Instantly share code, notes, and snippets.

@jney
Created December 2, 2010 21:15
Show Gist options
  • Select an option

  • Save jney/726080 to your computer and use it in GitHub Desktop.

Select an option

Save jney/726080 to your computer and use it in GitHub Desktop.
# compare 2 files, each line is trim, empty lines are removed, lines are sorted
diff <(cat file1.txt | awk '{gsub(/^ +| +$/,"")}1' | grep -v '^\s*$' | sort) \
<(cat file2.txt | awk '{gsub(/^ +| +$/,"")}1' | grep -v '^\s*$' | sort)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment