huangwason
Programmer
for instance, print out something like:
400 202 402 204 404 206 ...
what I am thinking is use one variable manipulates digits begin with 4, another variable for digits begin with 2.
for ((i=0,j=1;i<=2,j<=3;i++,j++));do
printf "%s %s" 400+$i*2 200+$j*2
done
the problem is that it looks like i and j are always in the same length, the above code can not output like
400 202 402 204 404 206 208 210 212
any proposal? thanks first
400 202 402 204 404 206 ...
what I am thinking is use one variable manipulates digits begin with 4, another variable for digits begin with 2.
for ((i=0,j=1;i<=2,j<=3;i++,j++));do
printf "%s %s" 400+$i*2 200+$j*2
done
the problem is that it looks like i and j are always in the same length, the above code can not output like
400 202 402 204 404 206 208 210 212
any proposal? thanks first