【发布时间】:2019-11-09 23:16:24
【问题描述】:
我有一个程序 GG,它需要两个整数作为参数 x 和 y 作为输入的参数,这样:
./GG -x 0 -y 100
我需要在连续的开始/结束整数对上运行 GG,就像这里每一行中的对:
x y
0 100
100 200
200 300
... ...
10000 10100
我得到的最接近的是这样的:
for i in {0..10000}; do for j in {100..10100}; do ./GG -x ${i} -y ${j}; done; done
但这会将每个 j 值循环到每个 i 值上,这不是我需要的。
非常欢迎任何建议!
【问题讨论】:
-
嗯。 部分是How to produce a range with step n in bash to generate a sequence of numbers with的副本;我还没有为其余部分确定一个好的副本。