I have a loop in wich I check urls from file one-by-one and want to get the status header and the execution time of every request as result. I have two curl commands:
This one outputs the header communication (not wanted) and at the end the http status code and time 200 - 0,016
curl -w "%{http_code} - %{time_connect}" -I -s http://superuser.com >> test_result.txt
This one gets the line with the http status code from the header and prints it to the file HTTP/1.1 200 OK
curl -v -I -s http://superuser.com | findstr /c:"HTTP" >> test_result.txt
How can I combine these two commands to get output from one request as this
HTTP/1.1 200 OK - 0,016
so extracting the line with http header and appending the execution time without all other headers in file