check-dups.sh multi-word section #321

This commit is contained in:
edoardottt
2026-07-17 15:17:33 +02:00
parent 267437ed9b
commit 83ea4d0feb
+7 -4
View File
@@ -29,8 +29,11 @@ check_section() {
# Get all unique section headings from the README file and handle spaces and slashes
sections=$(grep '^### ' "$readme" | sed 's/^### //' | sed 's/[\/&]/\\&/g')
# Call the function for each section
for section in $sections; do
check_section "$section"
done
# Call the function for each section, reading line by line to preserve spaces
while IFS= read -r section; do
if [[ -n "$section" ]]; then
check_section "$section"
fi
done <<< "$sections"
echo "[ OK! ] NO DUPLICATES FOUND."