Created
January 30, 2020 05:46
-
-
Save uhziel/b7ebcd2b002fd5da2ef250c8eeb120ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function check_url_exist { | |
# via https://stackoverflow.com/questions/12199059/how-to-check-if-an-url-exists-with-the-shell-and-probably-curl/12199125 | |
url=$1 | |
if curl --output /dev/null --silent --head --fail "$url"; then | |
echo "URL exists: $url" | |
#else | |
#echo "URL does not exist: $url" | |
fi | |
} | |
function check_urls_exist { | |
for ((i=$1; i<=$2; i++)) | |
do | |
check_url_exist "http://www.china.com.cn/chinese/zhuanti/feiyan/$i.htm" | |
done | |
} | |
check_urls_exist 325398 326489 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment