Created
May 30, 2014 07:28
-
-
Save morimori/4d128eee4612b688b2fa to your computer and use it in GitHub Desktop.
ファイルに書かれた URL をチェックして、cURL の exit コードと HTTP ステータスコードを表示する
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/sh | |
echo "curl exit code\thttp status code\turl" | |
while read url ; do | |
http_status=$(curl -L -f -s -A 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:29.0) Gecko/20100101 Firefox/29.0' "${url}" -o /dev/null -w '%{http_code}\n') | |
echo "${?}\t${http_status}\t${url}" | |
sleep 1 | |
done < $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment