2015-10-19 22 views
0

我試圖下載幾百個URL並指定每個的輸出名稱,唯一的區別是URL中的ID,例如..something/1/something..,..something/3/something..,..something/4/something..使用範圍在curl上指定多個文件的輸出名稱

我可以用-o filename.zip,但它會覆蓋每個文件的範圍內的,我目前使用的:

curl -o file.zip http://example.com/something/[1-500]/something/example/foo/bar/comma/zip 

我怎樣才能輸出,因爲這:?

file1.zip,file3.zip,file4.zip,..等

回答

1

在你的shell的簡單循環會做的伎倆例如爲:

#!/bin/bash 
for i in `seq 1 500`; do 
    curl -o file$i.zip http://example.com/something/$i/something/example/foo/bar/comma/zip 
done 
+0

謝謝,完美的作品! –

相關問題