Skip to main content
Added description of differences between seq and bash brace expansion.
Source Link
Rob Bednark
  • 28.8k
  • 28
  • 90
  • 131

I'd do

for i in `seq 0 2 10`; do echo $i; done 

(though of course seq 0 2 10 will produce the same output on its own).

Note that seq allows floating-point numbers (e.g., seq .5 .25 3.5) but bash's brace expansion only allows integers.

I'd do

for i in `seq 0 2 10`; do echo $i; done 

(though of course seq 0 2 10 will produce the same output on its own).

I'd do

for i in `seq 0 2 10`; do echo $i; done 

(though of course seq 0 2 10 will produce the same output on its own).

Note that seq allows floating-point numbers (e.g., seq .5 .25 3.5) but bash's brace expansion only allows integers.

Source Link
chaos
  • 124.8k
  • 34
  • 306
  • 310

I'd do

for i in `seq 0 2 10`; do echo $i; done 

(though of course seq 0 2 10 will produce the same output on its own).