Skip to content

check-dups.sh word-splits multi-word section headings, can miss cross-section duplicates #321

Description

@chirag127

Problem

scripts/check-dups.sh word-splits section headings on whitespace, so multi-word sections like ### General Search Engines are never checked as intact units and cross-section duplicates can escape CI.

Steps

  1. mkdir t && cd t
  2. Create README.md:
### Alpha Beta

- [foo](https://a.example)

### Gamma Delta

- [foo](https://a.example)
  1. Copy scripts/check-dups.sh beside it and run: bash check-dups.sh

Expected

Exit 1 with [ ERR ] DUPLICATE LINKS FOUND — same URL appears in two sections.

Actual

[ OK! ] NO DUPLICATES FOUND. (exit 0)

Root cause at scripts/check-dups.sh:33: for section in $sections; word-splits, so check_section runs with Alpha, Beta, Gamma, Delta — awk pattern /^### Alpha/ matches only ### Alpha Beta; /^### Beta/ matches nothing. Cross-section duplicate hides. Fix: while IFS= read -r section; do ... done <<< "$sections".

Environment

Ubuntu 22.04 (workflow runs-on: ubuntu-latest per .github/workflows/check-duplicates.yml:12), GNU bash 5.x, GNU awk.

Thanks for maintaining edoardottt/awesome-hacker-search-engines!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions