dbt-labs / dbt-completion.bash

Adds autocompletion to the dbt CLI
https://www.getdbt.com/
Apache License 2.0
116 stars 29 forks source link

Fix support for Linux (support GNU version of `seq`) #4

Closed andehen closed 5 years ago

andehen commented 5 years ago

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