I have a text file which has few Url's
salesData.txt
http://localhost:9380/run?startDate=2018-12-01&endDate=2018-12-31
http://localhost:9380/run?startDate=2018-10-01&endDate=2018-10-31
http://localhost:9380/run?startDate=2018-09-01&endDate=2018-09-30
http://localhost:9380/run?startDate=2018-08-01&endDate=2018-08-31
and a bash script as belows:
mapfile -t salesData < salesData.txt
i=0
echo 'hii'${i};
while [ ${i} -lt ${#salesData[@]} ] ; do
echo "Iteration Number is " ${i} >> audit.txt
curl -s --max-time 3600 ${salesData[${i}]}
sleep 30
echo "Successfully completed curl"
((i++))
done
This script is only running the first two curl commands and it is abruptly stopping. I am running this on a linux server by using a ssh connection to that box. How can i make sure all the curl commands get executed in sequential fashion and not just first two. I have to pull a lot bigger data which will have 12 curl commands ,i want to execute them in a sequential manner without script timing out.
Can someone please provide some guidance on this please?
ssh -n.