diff --git a/SC1120.md b/SC1120.md new file mode 100644 index 0000000..9078a96 --- /dev/null +++ b/SC1120.md @@ -0,0 +1,27 @@ +## No comments allowed after here-doc token. Comment the next line instead. + +### Problematic code: + +```sh +cat << eof # --- Start greeting -- +Hello +eof # --- End greeting --- +``` + +### Correct code: + +```sh +cat << eof # --- Start greeting -- +Hello +eof + # --- End greeting --- +``` +### Rationale: + +The terminator token for a here document must be on an entirely separate line. No comments are allowed after it. + +Move the comment somewhere else, such as the next line. + +### Exceptions: + +None \ No newline at end of file