help in display a sequence of number
I am doing a exercise for using for and while loop to perform from tw0 any variable by using command seq; but it is used for increasable number such as: 3 to 15 or 1 to 10..i was wonder like how about to perform from 15 to 3 or from 10 to 1; such as: using first and last flags...Plz help me to tide off this complex...Thanks for reading
|
Code:
seq 15 -1 3 |
In man seq you see:
Quote:
Code:
for x in $(seq 15 -1 3); do echo $x; done Code:
for x in $(seq 10 -1 1); do echo $x; done Code:
for x in {15..1}; do echo $x; done Code:
for x in $(seq 15 -5 3); do echo $x; done |
thanks a lot guys...It got a very quick and nice lesson for my first step to bash script..thanks and cheers
|
All times are GMT -5. The time now is 01:21 PM. |