#!/usr/bin/env bash
for url in `cat urls.txt`; do
curl "$url" -D ./check-head 2>./check-error -o /dev/null
if [ $? == "0" ]; then
res=`head -n 1 ./check-head | awk '{print $2}'`
else
res=`cat ./check-error`
fi
echo $url - $res
done
rm ./check-head ./check-error