在 Kubuntu 15.10 上
echo $BASH_VERSION
4.3.42(1)-release
我试试
reps=1
threads={1}{10..60..10}
for((r=0;r<$reps;r++))
do
tCount=0
for t in $threads
do
echo "t=$t, tCount=${tCount}"
#do something funny with it
((tCount++))
done
done
它产生一条线
t={1}{10..60..10}, tCount=0
我怎样才能让它工作?
编辑
我预计
t=1, tCount=0
t=10, tCount=1
t=20, tCount=2
t=30, tCount=3
t=40, tCount=4
t=50, tCount=5
t=60, tCount=6
更新
注意threads=({1}{10..60..10})
进而for t in ${threads[@]}
将在10..60..10
范围前加上字符串{1}
(即{1}10,{1}20,..,{1}60
)