I have iterate over numbers in various order. I am able to display them in increasing order, even with steps like:
$ seq --separator="," 1 10
1,2,3,4,5,6,7,8,9,10
$ seq --separator="," 1 2 10
1,3,5,7,9
I am also able to display them in reverse order, neither continuous nor step wise.
$ seq --separator="," 10 1
$ seq --separator="," 10 2 1
No output for above commands.
My shell details:
$ bash --version
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
Let me know how I would be able to display the numbers in descending order?
seq
is a completely nonstandard tool and there is no guarantee that any two implementations will be the same. If you need to write a loop that iterates backwards over numbers in bash, usefor ((i=$max;i>=0;i--)) …
or the like. – kojiro Feb 15 '13 at 13:13