I got a bash script which reads URLs from different .txt files (ven Array defines the txt files) and I curl them and if the Response Code is not 200 it writes an error in error.txt
Sadly it always does it at the end, even if there is no error in any of the links, any idea why?
for i in "${ven[@]}"; do
while IFS='' read -r line || [[ -n "$line" ]]; do
IP=$(curl --write-out '%{http_code}' --silent --output /dev/null $line?upstream=$1)
if [ $IP != 200 ]
then
counter=$((counter + 1))
echo $(date +"%d.%m.%y %T") : $line >> error.txt
fi
done < $i
done
venarray?