如何在bash shell中执行for循环生成的curl命令?

问题描述 投票:0回答:1

我从for循环生成了curl命令。

for ((i=1; i<=1000; i++)); do  
echo "curl http://example.com/page.php?page=$i"; done 

现在它打印出所需的curl命令。而不是只打印curl命令我想执行curl命令。我如何使它工作?

提前致谢。

bash macos shell curl
1个回答
0
投票

我通过简单地删除@PesaThe建议的echo命令解决了。

for ((i=1; i<=1000; i++)); do  
curl "http://example.com/page.php?page=$i"; done 

谢谢@PesaThe。

© www.soinside.com 2019 - 2024. All rights reserved.