Skip to content

Instantly share code, notes, and snippets.

@ftorto
Created February 24, 2017 06:52
Show Gist options
  • Save ftorto/9e268900f1fbd62448e8fd9c9015c97f to your computer and use it in GitHub Desktop.
Save ftorto/9e268900f1fbd62448e8fd9c9015c97f to your computer and use it in GitHub Desktop.
Compare 2 lists
# List common lines in $1 and $2
function common {
comm --check-order -12 $1 $2
}
# List lines only present in $1
function onlyina {
comm --check-order -3 $1 $2 | sed '/\t/d'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment