Created
July 26, 2017 16:14
-
-
Save iitenkida7/76bbcef71277dc28067fa4e9e099afa6 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 | |
#概要:URLリストを渡し、「200 OK」 ステータスのものだけ表示する。 | |
#実行:check_url_200ok @file_name@ | |
#OUT :200 OK URL一覧 | |
function check_url_200ok (){ | |
for URL in $(cat $1) ; do | |
RESULT_CODE=$(curl -LI ${URL} -o /dev/null -s -w '%{http_code}\n' -s) | |
if [ "_${RESULT_CODE}" == "_200" ] ; then | |
echo "${URL}" | |
fi | |
done | |
return 0 | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment