Created
June 9, 2017 04:09
-
-
Save infinite-Joy/3f976616064d6e03fa07af4c3d19a871 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
function last_difference | |
{ | |
grep -n "${pattern}" "${parse_file}" \ | |
| tail -1 | awk '{print $1}' |\ | |
cut -d ":" -f1 | |
} | |
function all_differences | |
{ | |
cat "${parse_file}" | awk 'NR>="$(last_difference)"' | |
} | |
function duplicates | |
{ | |
echo "" > _tmp_dup.txt | |
while read x; do | |
# take only the paths | |
echo "${x}" | awk '{print $3}' >> _tmp_dup.txt | |
done | |
# get only the duplicates | |
cat _tmp_dup.txt | awk '++A[$1]==2' | |
} | |
function only_once | |
{ | |
diff <(all_differences | awk '{print $3}' | uniq )\ | |
<(all_differences | duplicates) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment