Using seq , you can say seq FIRST STEP LAST . In your case:
seq 0 0.1 2.5
Then it is a matter of storing these values ββin an array:
vals=($(seq 0 0.1 2.5))
Then you can check the values ββwith:
$ printf "%s\n" "${vals[@]}" 0,0 0,1 0,2 ... 2,3 2,4 2,5
Yes, my locale is set to comma instead of dots for decimals. This can be changed by setting LC_NUMERIC="en_US.UTF-8" .
By the way, brace expansion also allows you to set the increment. The problem is that it must be an integer:
$ echo {0..15..3} 0 3 6 9 12 15
source share