I want to extract from a website multiple files, but I don't want to do this manually.
Instead I want to download these files until there is an error like: ERROR 404: Not Found.
For example I have on this website some files called:
file1.txt
file2.txt
.
.
.
file10.txt
and I use wget http:...
.
If I try to download file11.txt
, which does not exists, I get the ERROR 404: Not Found
Error.
If I try to do something like:
while [condition]
do
NR=$((NR+1));
wget ...
done
where NR
is the variable that will change the number of the file.
What should I use as condition
to stop the loop when it reaches a file that does not exist?