commit e100628b129aeea3b1bbab36fa8e070e4baef75a
Author: Hiltjo Posthuma <[email protected]>
Date: Sun May 10 16:04:27 2020 +0200
checklinks.sh: use awk instead of grep -vE, exclude atom.xml
diff --git a/checklinks.sh b/checklinks.sh
index b51d5bd3..86bb409d 100755
--- a/checklinks.sh
+++ b/checklinks.sh
@@ -7,9 +7,16 @@ find "$t" -name "*.md" -type f | while read -r f; do
b=$(basename "$f")
./md-printlinks < "$f" | \
- grep -vE '^(http|https|gopher|irc|ircs|git)://' | \
- grep -vE '^\/\/(lists|dl|git|gunther|oldgit)\.' | \
- grep -vE '^mailto:' | \
+ awk -F ' ' '
+/^(http|https|gopher|irc|ircs|git):\/\// { next; }
+/^\/\/(lists|dl|git|gunther|oldgit)\./ { next; }
+/^mailto:/ { next }
+/^mailto:/ { next }
+/^\/\/suckless\.org\/atom\.xml$/ { next }
+{
+ print $0;
+}
+' | \
while read -r -- l; do
# // relative