Created
February 13, 2018 23:36
-
-
Save Phoenix616/d1212c6ebdff779c859aa7b8d3d9a322 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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