0

I want to download file from a site that provides download link as

http://abc.com/blahblahblah/XXX/PQR/XXX.jpeg

here XXX change over a range. i have tried using curl but it wont work it start downloading combinations of both the ranges. i want both XXX before and after PQR to change simultaneously (both have to be same all the time)

4

1 回答 1

0

您是否考虑过使用bash for 循环

#!/bin/bash

for x in {001..020}; do
    wget "http://abc.com/blahblahblah/$x/PQR/$x""_jpeg.jpeg"
done

如果你想XXX在路径和YYY文件名中相互独立,你可以嵌套两个for循环:

#!/bin/bash

for x in {001..020}; do
    for y in {001..099}; do
        wget "http://abc.com/blahblahblah/$x/PQR/$y""_jpeg.jpeg"
    done
done
于 2013-03-16T02:42:48.223 回答