Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
echo "File: unique (total - duplicate)"
for file in "$@"; do
for compare in "$@"; do
if [ "$file" == "$compare" ]; then
continue;
fi;
cat $compare >> /tmp/get_unique_line_count-others.txt
done;
lines=$(cat $file | wc -l)
duplicate=$(comm -12 <( sort $file ) <( sort /tmp/get_unique_line_count-others.txt ) | wc -l)
let "unique = $lines - $duplicate"
echo "$file: $unique ($lines - $duplicate)"
rm /tmp/get_unique_line_count-others.txt
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment