Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Wget Help please

Comments

  • Registered Users, Registered Users 2 Posts: 604 ✭✭✭Kai


    use a batch file to get each one individually ? have a counter that increments for each image.


  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    Put all the URLs in a txt file (easy enough to copy and paste then change number in 250 lines). Then use wget -i filelist.txt


  • Closed Accounts Posts: 7,563 ✭✭✭leeroybrown


    Asuming a bash shell save this as a shell script and run it:
    #!/bin/bash
    
    for ((i = 1; i <= 250; i++))
    do
        wget http://www.domainname.net/images/$i.jpg
    done
    

    This will need minor modification if the names are '001.jpg' and not '1.jpg'


  • Registered Users, Registered Users 2 Posts: 1,186 ✭✭✭davej


    yes you forgot to take leading zeros into account which can be inserted using (s)printf:

    this should work on the command line:

    perl -e 'for ($i=1;$i<251;$i++){$command = sprintf ("wget http://www.domainname.net/images/%03d.jpg",$i);$cmd= `$command`;}'

    davej


  • Registered Users, Registered Users 2 Posts: 604 ✭✭✭Kai


    he said he was using the win32 version though.


  • Advertisement
  • Closed Accounts Posts: 825 ✭✭✭MarcusGarvey


    I ended up using the win32 version of curl which allowed me to use the following command:

    curl -f -O "http://www.domainname.net/images/[001-240].jpg&quot;

    Thanks for the suggestions though.


Advertisement