#!/bin/bash #author longxibendi #blog #function get the web servers information of companies' if [ -e /tmp/web_server.log ] ;then rm -f /tmp/web_server.log fi if [ -e /tmp/ab.log ] ; then rm -f /tmp/ab.log fi for company_name in taobao 360buy dangdang vancl mbaobao alibaba google baidu yahoo sina sohu renren changyou wanmei sdo 126 163 139 do # { ab -n 1 -c 1 http://www.${company_name}.com/index.html | tee /tmp/ab.log 2>&1 if [ $? -eq 0 ] ; then printf "%10s, %20s\n" "${company_name}.com", " ` cat /tmp/ab.log | grep "Server Software" ` " >> /tmp/web_server.log fi # sleep 3 # }& done wait echo "It is OK "
2.说明