diff --git a/SC1137.md b/SC1137.md new file mode 100644 index 0000000..040058d --- /dev/null +++ b/SC1137.md @@ -0,0 +1,30 @@ +## Missing second '(' to start arithmetic for ((;;)) loop + +### Problematic code: + +```sh +for (i=0; i<10; i++)) +do + echo $i +done +``` + +### Correct code: + +```sh +for ((i=0; i<10; i++)) +do + echo $i +done +``` +### Rationale: + +ShellCheck found an arithmetic `for ((;;))` expression where either the `((` or the `))` did not come as a pair. Make sure to use `(( ))` and not `( )`. + +### Exceptions: + +None. + +### Related resources: + +* Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc! \ No newline at end of file