0

I need to parse links from an array[0] - array[3] which are all URLs and send to a for loop which is cURL and will download the html and shoot it too another array. Getting the error no URL specified!

echo "${array[0]}"

for i in ${array[@]}
do
   dataset=($(curl -d \ $i))
done

1 Answer 1

1

Two things, the -d is a post and you indicated you wanted to download. Appending to arrays is as easy as +=(). You can do something like this:

dataset=()
for i in ${array[@]}
do
   dataset+=($(curl --silent $i))
done
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.