I’m using cURL to download files to a local folder. The command I’m using looks like this:
curl -O http://example.com/example/file[001-030]_file_[1-30]_eng.ext
I want the numbers to increment at the same time (“file001_file_1_eng.ext”) so they match up. Instead this is working like a nested loop and the command is writing a bunch of empty files to the folder along with the existing files. So I get:
file001_file_1_eng.ext
file001_file_2_eng.ext <--- file doesn't exist
file001_file_3_eng.ext <--- file doesn't exist
etc…
So, I’m wondering how to get them to increment in the correct way.
I’m looking to get this output:
example.com/example/file008_file_1_eng.text
example.com/example/file009_file_2_eng.text
example.com/example/file010_file_3_eng.text
example.com/example/file011_file_4_eng.text
example.com/example/file012_file_5_eng.text
example.com/example/file013_file_6_eng.text
example.com/example/file014_file_7_eng.text
example.com/example/file015_file_8_eng.text
example.com/example/file016_file_9_eng.text ... and so on.
I think you might want to use a
forloop:With this loop, the url’s the you should get are the following ones: