我试着这样一行:
for i in {1..600}; do wget http://mydomain.com/search/link $i % 5; done;
我想得到的输出是:
wget http://mydomain.com/search/link0 wget http://mydomain.com/search/link1 wget http://mydomain.com/search/link2 wget http://mydomain.com/search/link3 wget http://mydomain.com/search/link4 wget http://mydomain.com/search/link0
但我实际得到的只是:
wget http://mydomain.com/search/link
尝试以下操作:
原文链接:https://www.f2er.com/bash/392335.htmlfor i in {1..600}; do echo wget http://mydomain.com/search/link$(($i % 5)); done
$(())语法做一个arithmetic evaluation的内容。