From 86b4915907d69efd704f3b2deba39ead9f76ffd0 Mon Sep 17 00:00:00 2001 From: David Holdeman Date: Mon, 15 Feb 2021 21:47:06 -0600 Subject: [PATCH] fix script --- wiki-tools/brokenlinks.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wiki-tools/brokenlinks.sh b/wiki-tools/brokenlinks.sh index 640a22a2..93a76226 100644 --- a/wiki-tools/brokenlinks.sh +++ b/wiki-tools/brokenlinks.sh @@ -24,6 +24,10 @@ searchfile() { else echo $link FILES=$(find . -iname "*$(basename $link)*") + if [ $(echo -n "$FILES" | wc -c) -lt 1 ]; then + echo "Could not find" + continue + fi echo "$FILES" | cat --number read PICK FILE=$(echo "$FILES" | head -n $PICK | tail -n 1) @@ -35,6 +39,10 @@ searchfile() { fi echo $link FILES=$(find . -iname "*$(basename $link)*") + if [ $(echo -n "$FILES" | wc -c) -lt 1 ]; then + echo "Could not find" + continue + fi echo "$FILES" | cat --number read PICK FILE=$(basename "$(echo "$FILES" | head -n $PICK | tail -n 1)" .md)