Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7508453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:41:06+00:00 2026-05-29T22:41:06+00:00

I’m using cURL to download files to a local folder. The command I’m using

  • 0

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. 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:41:07+00:00Added an answer on May 29, 2026 at 10:41 pm

    I think you might want to use a for loop:

    #!/bin/bash
    for i in {0..30}; do
        printf -v url "http://example.com/example/file%03d_file_%d_eng.text" $i $i
        curl -O $url
    done
    

    With this loop, the url’s the you should get are the following ones:

    http://example.com/example/file000_file_0_eng.text
    http://example.com/example/file001_file_1_eng.text
    http://example.com/example/file002_file_2_eng.text
    http://example.com/example/file003_file_3_eng.text
    http://example.com/example/file004_file_4_eng.text
    http://example.com/example/file005_file_5_eng.text
    http://example.com/example/file006_file_6_eng.text
    http://example.com/example/file007_file_7_eng.text
    http://example.com/example/file008_file_8_eng.text
    http://example.com/example/file009_file_9_eng.text
    http://example.com/example/file010_file_10_eng.text
    http://example.com/example/file011_file_11_eng.text
    http://example.com/example/file012_file_12_eng.text
    http://example.com/example/file013_file_13_eng.text
    http://example.com/example/file014_file_14_eng.text
    http://example.com/example/file015_file_15_eng.text
    http://example.com/example/file016_file_16_eng.text
    http://example.com/example/file017_file_17_eng.text
    http://example.com/example/file018_file_18_eng.text
    http://example.com/example/file019_file_19_eng.text
    http://example.com/example/file020_file_20_eng.text
    http://example.com/example/file021_file_21_eng.text
    http://example.com/example/file022_file_22_eng.text
    http://example.com/example/file023_file_23_eng.text
    http://example.com/example/file024_file_24_eng.text
    http://example.com/example/file025_file_25_eng.text
    http://example.com/example/file026_file_26_eng.text
    http://example.com/example/file027_file_27_eng.text
    http://example.com/example/file028_file_28_eng.text
    http://example.com/example/file029_file_29_eng.text
    http://example.com/example/file030_file_30_eng.text
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to render a haml file in a javascript response like so:
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.