2023-04-12 12:15:59 +02:00
|
|
|
#!/bin/bash
|
2023-04-12 16:18:02 +02:00
|
|
|
#
|
2023-06-08 12:20:32 +02:00
|
|
|
# https://github.com/edoardottt/awesome-hacker-search-engines
|
|
|
|
#
|
2023-04-12 16:18:02 +02:00
|
|
|
# This script checks if there are duplicate entries in the README file.
|
|
|
|
#
|
2023-04-12 12:15:59 +02:00
|
|
|
|
|
|
|
readme="README.md"
|
|
|
|
|
2023-04-12 12:21:26 +02:00
|
|
|
pwd=$(pwd)
|
|
|
|
|
|
|
|
if [[ "${pwd: -7}" == "scripts" ]];
|
|
|
|
then
|
|
|
|
readme="../README.md"
|
|
|
|
fi
|
|
|
|
|
2023-04-12 12:15:59 +02:00
|
|
|
links=$(cat $readme | egrep "\- \[" | wc -l)
|
|
|
|
|
|
|
|
uniqlinks=$(cat $readme | egrep "\- \[" | uniq | wc -l)
|
|
|
|
|
|
|
|
if [[ $links -eq $uniqlinks ]];
|
|
|
|
then
|
2023-04-16 09:15:42 +02:00
|
|
|
echo "[ OK! ] NO DUPLICATES FOUND."
|
2023-04-16 09:17:30 +02:00
|
|
|
echo "$links links in README."
|
2023-04-12 12:15:59 +02:00
|
|
|
else
|
2023-04-16 09:15:42 +02:00
|
|
|
echo "[ ERR ] DUPLICATES FOUND!"
|
2023-04-12 12:15:59 +02:00
|
|
|
cat $readme | egrep "\- \[" | uniq -c | egrep -iv "1 - ["
|
|
|
|
fi
|