awesome-hacker-search-engines/scripts/check-dups.sh

22 lines
390 B
Bash
Raw Normal View History

2023-04-12 06:15:59 -04:00
#!/bin/bash
readme="README.md"
2023-04-12 06:21:26 -04:00
pwd=$(pwd)
if [[ "${pwd: -7}" == "scripts" ]];
then
readme="../README.md"
fi
2023-04-12 06:15:59 -04:00
links=$(cat $readme | egrep "\- \[" | wc -l)
uniqlinks=$(cat $readme | egrep "\- \[" | uniq | wc -l)
if [[ $links -eq $uniqlinks ]];
then
echo "NO DUPLICATES FOUND."
else
echo "DUPLICATES FOUND!"
cat $readme | egrep "\- \[" | uniq -c | egrep -iv "1 - ["
fi