commit e100628b129aeea3b1bbab36fa8e070e4baef75a parent cbc12f046c4c511d400233b09ae36706e9e81a3e Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 10 May 2020 16:04:27 +0200 checklinks.sh: use awk instead of grep -vE, exclude atom.xml Diffstat:
M | checklinks.sh | | | 13 | ++++++++++--- |
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git 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 '\t' ' +/^(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