Try downloading images with zeros using wget [duplicate]












0
















This question already has an answer here:




  • How to zero pad a sequence of integers in bash so that all have the same width?

    11 answers




When I run the following command in linux:



wget http://page.com/{0000..0100}.jpg


he tries to download the following sequence:




http://page.com/0.jpg



http://page.com/1.jpg



http://page.com/2.jpg



http://page.com/3.jpg



...



http://page.com/100.jpg




that is, it does not place the zeros.










share|improve this question















marked as duplicate by zerkms, tripleee bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 23 '18 at 5:29


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.























    0
















    This question already has an answer here:




    • How to zero pad a sequence of integers in bash so that all have the same width?

      11 answers




    When I run the following command in linux:



    wget http://page.com/{0000..0100}.jpg


    he tries to download the following sequence:




    http://page.com/0.jpg



    http://page.com/1.jpg



    http://page.com/2.jpg



    http://page.com/3.jpg



    ...



    http://page.com/100.jpg




    that is, it does not place the zeros.










    share|improve this question















    marked as duplicate by zerkms, tripleee bash
    Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

    StackExchange.ready(function() {
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function() {
    $hover.showInfoMessage('', {
    messageElement: $msg.clone().show(),
    transient: false,
    position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
    dismissable: false,
    relativeToBody: true
    });
    },
    function() {
    StackExchange.helpers.removeMessages();
    }
    );
    });
    });
    Nov 23 '18 at 5:29


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





















      0












      0








      0









      This question already has an answer here:




      • How to zero pad a sequence of integers in bash so that all have the same width?

        11 answers




      When I run the following command in linux:



      wget http://page.com/{0000..0100}.jpg


      he tries to download the following sequence:




      http://page.com/0.jpg



      http://page.com/1.jpg



      http://page.com/2.jpg



      http://page.com/3.jpg



      ...



      http://page.com/100.jpg




      that is, it does not place the zeros.










      share|improve this question

















      This question already has an answer here:




      • How to zero pad a sequence of integers in bash so that all have the same width?

        11 answers




      When I run the following command in linux:



      wget http://page.com/{0000..0100}.jpg


      he tries to download the following sequence:




      http://page.com/0.jpg



      http://page.com/1.jpg



      http://page.com/2.jpg



      http://page.com/3.jpg



      ...



      http://page.com/100.jpg




      that is, it does not place the zeros.





      This question already has an answer here:




      • How to zero pad a sequence of integers in bash so that all have the same width?

        11 answers








      bash






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 23 '18 at 0:12









      melpomene

      61.6k54994




      61.6k54994










      asked Nov 23 '18 at 0:07









      alexalex

      436




      436




      marked as duplicate by zerkms, tripleee bash
      Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Nov 23 '18 at 5:29


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by zerkms, tripleee bash
      Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Nov 23 '18 at 5:29


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


























          2 Answers
          2






          active

          oldest

          votes


















          1














          Consider upgrading Bash. Your code works on Bash4+:



          $ echo $BASH_VERSION {001..003}
          4.4.19(1)-release 001 002 003


          but not on older versions like Bash 3.x:



          $ echo $BASH_VERSION {001..003}
          3.2.57(1)-release 1 2 3


          If you're unable to upgrade, you can use printf as a workaround:



          wget $(printf "http://page.com/%04d.jpgn" {1..100})





          share|improve this answer































            1














            The bash expansion isn't going to pad teh numbers to use mathematically insignificant zeros. You can use seq with the -w (width) option to pad with leading zeros.



            for i in `seq -w 1 1000`
            do
            wget http://example.com/path/to/$i.jpg
            done





            share|improve this answer






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              Consider upgrading Bash. Your code works on Bash4+:



              $ echo $BASH_VERSION {001..003}
              4.4.19(1)-release 001 002 003


              but not on older versions like Bash 3.x:



              $ echo $BASH_VERSION {001..003}
              3.2.57(1)-release 1 2 3


              If you're unable to upgrade, you can use printf as a workaround:



              wget $(printf "http://page.com/%04d.jpgn" {1..100})





              share|improve this answer




























                1














                Consider upgrading Bash. Your code works on Bash4+:



                $ echo $BASH_VERSION {001..003}
                4.4.19(1)-release 001 002 003


                but not on older versions like Bash 3.x:



                $ echo $BASH_VERSION {001..003}
                3.2.57(1)-release 1 2 3


                If you're unable to upgrade, you can use printf as a workaround:



                wget $(printf "http://page.com/%04d.jpgn" {1..100})





                share|improve this answer


























                  1












                  1








                  1







                  Consider upgrading Bash. Your code works on Bash4+:



                  $ echo $BASH_VERSION {001..003}
                  4.4.19(1)-release 001 002 003


                  but not on older versions like Bash 3.x:



                  $ echo $BASH_VERSION {001..003}
                  3.2.57(1)-release 1 2 3


                  If you're unable to upgrade, you can use printf as a workaround:



                  wget $(printf "http://page.com/%04d.jpgn" {1..100})





                  share|improve this answer













                  Consider upgrading Bash. Your code works on Bash4+:



                  $ echo $BASH_VERSION {001..003}
                  4.4.19(1)-release 001 002 003


                  but not on older versions like Bash 3.x:



                  $ echo $BASH_VERSION {001..003}
                  3.2.57(1)-release 1 2 3


                  If you're unable to upgrade, you can use printf as a workaround:



                  wget $(printf "http://page.com/%04d.jpgn" {1..100})






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 23 '18 at 2:19









                  that other guythat other guy

                  74.4k885124




                  74.4k885124

























                      1














                      The bash expansion isn't going to pad teh numbers to use mathematically insignificant zeros. You can use seq with the -w (width) option to pad with leading zeros.



                      for i in `seq -w 1 1000`
                      do
                      wget http://example.com/path/to/$i.jpg
                      done





                      share|improve this answer




























                        1














                        The bash expansion isn't going to pad teh numbers to use mathematically insignificant zeros. You can use seq with the -w (width) option to pad with leading zeros.



                        for i in `seq -w 1 1000`
                        do
                        wget http://example.com/path/to/$i.jpg
                        done





                        share|improve this answer


























                          1












                          1








                          1







                          The bash expansion isn't going to pad teh numbers to use mathematically insignificant zeros. You can use seq with the -w (width) option to pad with leading zeros.



                          for i in `seq -w 1 1000`
                          do
                          wget http://example.com/path/to/$i.jpg
                          done





                          share|improve this answer













                          The bash expansion isn't going to pad teh numbers to use mathematically insignificant zeros. You can use seq with the -w (width) option to pad with leading zeros.



                          for i in `seq -w 1 1000`
                          do
                          wget http://example.com/path/to/$i.jpg
                          done






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Nov 23 '18 at 0:44









                          ivanivanivanivan

                          1,683268




                          1,683268















                              Popular posts from this blog

                              "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

                              Alcedinidae

                              RAC Tourist Trophy