Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 19 lines (13 sloc) 390 Bytes
#!/bin/bash
# Collect all dead links in a file
find . -name \*.md -exec markdown-link-check {} \; 2>/dev/null | egrep "[✖]" > broken.txt
# Count the number of lines, extract only that number
n_broken=$(wc broken.txt --lines | cut -f 1 -d " ")
if [[ $n_broken > 0 ]]
then
echo "Number of broken files: "$n_broken
cat broken.txt
rm broken.txt
exit $n_broken
fi
rm broken.txt
You can’t perform that action at this time.