From 15c0e59a6800d06db9fe9f4d4454fe7795554ed0 Mon Sep 17 00:00:00 2001 From: Evgeniy Sokolov Date: Fri, 13 Jan 2017 01:25:37 +0100 Subject: [PATCH] fix --- files/.travis.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/.travis.sh b/files/.travis.sh index 76cd4bf..3649c88 100644 --- a/files/.travis.sh +++ b/files/.travis.sh @@ -38,9 +38,10 @@ while read FILE; do echo "Проверка файла $FILE на битые ссылки... "; while read LINK; do echo -n "Ссылка $LINK ... "; + REGEXP_LINK=$(echo $LINK | sed 's/[]\.|$(){}?+*^]/\\&/g') LINK=$(echo "$LINK" | sed -e 's/\[/\\\[/g' -e 's/\]/\\\]/g' -e 's/\&/\&/g') status=$(curl --insecure -XGET -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36" -m 10 -L -s --head -w %{http_code} $LINK -o /dev/null) - expectedStatus=$(grep $LINK files/known_url.txt | cut -d',' -f1) + expectedStatus=$(grep -oP "[^,]+,$REGEXP_LINK$" files/known_url.txt | cut -d',' -f1) if [ -z "$expectedStatus" ]; then expectedStatus="200"