hosts="sm-eat-extrasmall-0 sm-eat-extrasmall-1 sm-eat-extrasmall-2 sm-eat-small-0 sm-eat-small-1 sm-eat-small-2 sm-save-extrasmall-0 sm-save-extrasmall-1 sm-save-small-0 sm-save-small-1 sm-save-small-2" mkdir -p data for h in $hosts; do echo $h 1>&2 ssh $h.cloudapp.net 'grep apt-in /var/log/cloud-init.log && grep Fetched.*in.*[0-9]s /var/log/cloud-init-output.log' > data/$h done fmt="%-30s %7s %4s %5s\n" printf "$fmt" "#host" total dl inst for h in $hosts; do took=$(sed -n 's,.*took \([^ ]*\)[ ].*,\1,p' data/$h) download=$(grep "^Fetched" "data/$h" | tail -n 1 | awk '{print $5}') download=${download%s} printf "$fmt" $h $took $download $((${took%.*}-$download)) done