This script was provided to us by my professor. I changed it a bit for usage and readability.
Is there a way to output the page source (even if to /dev/null) and just keep the details?
Code:
#!/bin/bash
if [ $# = 0 ] ; then
echo ""
echo " USAGE: $0 domain"
echo " Example: $0 bashscripts.org"
echo ""
else
curl $1 -w "http_code:%{http_code} \
| time_connect:%{time_connect} \
| time_total:%{time_total} \
| time_namelookup:%{time_namelookup} \
| speed_download:%{speed_download} \
| size_header:%{size_header}"
echo ""
fi