我正在尝试下载数百个 URL 并为每个指定输出名称,唯一的区别是 URL 中的 ID,例如 ..something/1/something..
, ..something/3/something..
, ..something/4/something..
等
我可以使用 -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、..等
最佳答案
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
关于php - 使用范围通过 curl 在多个文件上指定输出名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33217671/