The Mac version of seq supports omitting negative increment, whereas the
GNU version defaults to 1. Thus, with the GNU version of seq an empty list
is returned and no iteration takes place. Specifying a negative increment
works with both versions.
GNU version
~ $ for i in $(seq 2 0); do echo $i; done
~ $ for i in $(seq 2 -1 0); do echo $i; done
2
1
0
Mac version
~ $ for i in $(seq 2 0); do echo $i; done
2
1
0
~ $ for i in $(seq 2 -1 0); do echo $i; done
2
1
0
The Mac version of seq supports omitting negative increment, whereas the GNU version defaults to 1. Thus, with the GNU version of seq an empty list is returned and no iteration takes place. Specifying a negative increment works with both versions.
GNU version
Mac version