
Eu tenho um arquivo de nomes de domínio (~ 9.000 URLs). Estou tentando determinar o tempo necessário para executar uma solicitação curl bem-sucedida para todos os URLs.
#!/bin/bash
#read lines from file.
while read -r line || [[ -n "$line" ]]; do
#Start execution time.
start=`date +%s.%N`
curl -k -L $line
if (("$?" != "7")) || (("$?" != "6")) ||(("$?" != "35")) ; then
#If curl request is not one of these [error codes][1] then end execution time
end=`date +%s.%N`
fi
runtime=$( echo "$end - $start" | bc -l ) >> throughput.txt
#Can do an average on the file later.
done < urls.txt
Por algum motivo, o loop para após a leitura do primeiro URL. Alguém pode me ajudar a executar corretamente o script.