hi,
new to scripting and would like to know how can I have a script which will curl a few URLs and have the results such as the URLs being curled, dns lookup time, connection time, total time, etc save in a html format in a form of table with column and rows.
thank you.
I think we need an explanation of what is meant by "curl" in the question?
hi, by curl I mean using the program curl.....that is to say, I have a shell script which run the command curl with some option that will display the dns lookup time, connection time, total time, etc.....pls advise how can I have these results format into a html file in a form of table with column and rows......thank you....
can anyone pls help.....basically what I want is a script whereby I run the command curl -s -w '%{time_namelookup} %{time_connect} %{time_total}\n' -k -L http://www.website.com -o /dev/dull and the result to be display into a html file in a form of table with column and rows like the following example......thank you....
+++++++++++++++++++++++++++++++++++++++++++++++++++++
+URL +lookuptime +time_connect +time_toal +
+++++++++++++++++++++++++++++++++++++++++++++++++++++
+www.xxx +0.02 +0.05 +0.2 +
+++++++++++++++++++++++++++++++++++++++++++++++++++++
+www.yyy +0.04 +0.09 +1.2 +
+++++++++++++++++++++++++++++++++++++++++++++++++++++
Sorry for not replying sooner, here is something a bit like what you were after:
$ cat ./curl.ksh
URL=$1
if [ -z "${URL}" ]; then
echo "Usage: $0 URL"
exit 99
fi
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "+URL +lookuptime +time_connect +time_toal +"
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo -n "$1 +"
curl -s -w '%{time_namelookup} %{time_connect} %{time_total}\n' -k -L $1 -o /dev/dull | sed -e 's/ / + /g'
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
$
Here is a sample run:
$ ./curl.ksh
Usage: ./curl.ksh URL
$ ./curl.ksh http://news.bbc.co.uk
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+URL +lookuptime +time_connect +time_toal +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
http://news.bbc.co.uk +0.040 + 0.077 + 0.136
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$