1
rated 0 times
[
1]
[
0]
/ answers: 1 / hits: 7683
/ 3 Years ago, thu, september 9, 2021, 8:24:32
I have this list of URLs in a .txt file -which i'm suppose to get content of them. To achieve this, i decided to use cURL. With xargs curl < url-list.txt , i can display all the content of the URL within my terminal. With curl -o myFile.html www.example.com , i can save only 1 file.
There is also curl -O URL1 -O URL2 approach but it will be too long for me to do it.
How can i save multiple files at once?
Edit:
#!/bin/bash
file="filename"
while read line
do
curl -o "$line.html" "$line"
done < "$file"
i run the bash screen above and here is what happened:
More From » bash