Cain Manor

Your Guide To All Things Cain™

Expand a range of numbers

I always — always — for­get the seq com­mand

seq 1 5
1
2
3
4
5

It’s not in OS-X. How­ever, you can do the same thing using the built in bash

for X in {1..5}
> do
> echo $X
> done
1
2
3
4
5

You also have the very odd com­mand jot. The 5 below is the num­ber of times to do some­thing (0 is infin­ity.) The 1 is where to start. The third para­me­ter (not shown) is where you should end. It’s a funky command.

jot 5 1
1
2
3
4
5

Comments are closed.