I have a file of domain names (~9000 urls). I am trying to determine the time taken to execute a successful curl request for all the 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] 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
For some reason the loop stops after reading the first url. Can someone please help me correctly run the script.