From 8696779a4ef81de01cbdb2c736f043fc50a2ecc6 Mon Sep 17 00:00:00 2001 From: edoardottt Date: Wed, 12 Apr 2023 12:15:59 +0200 Subject: [PATCH] Add scripts --- scripts/check-dups.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 scripts/check-dups.sh diff --git a/scripts/check-dups.sh b/scripts/check-dups.sh new file mode 100755 index 0000000..2ee4e51 --- /dev/null +++ b/scripts/check-dups.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +readme="README.md" + +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 \ No newline at end of file