From a23d3b0f1f6a2687b4bd0432889caba3a582e7b7 Mon Sep 17 00:00:00 2001 From: koalaman Date: Tue, 2 Feb 2016 10:22:18 -0800 Subject: [PATCH] Created SC1101 (markdown) --- SC1101.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 SC1101.md diff --git a/SC1101.md b/SC1101.md new file mode 100644 index 0000000..025a0fb --- /dev/null +++ b/SC1101.md @@ -0,0 +1,26 @@ +## Delete trailing spaces after \ to break line (or use quotes for literal space). + +### Problematic code: + +```sh +# There are spaces after the backslash: +echo hello \ + world +``` + +### Correct code: + +```sh +# No spaces after the backslash: +echo hello \ + world +``` +### Rationale: + +To break a line you can use `\` before the line break. However, if there are spaces after the backslash, the escape will apply to them instead of the line break, and the command will not continue on the next line. + +Delete the trailing spaces to make the line break work correctly. + +### Exceptions: + +If you do want a literal escaped space at the end of a line you can ignore this error, but please reconsider and use quotes instead. Trailing whitespace is invisible and frequently stripped on purpose (by editor settings / precommits) or accident (copy-paste), and so should not be relied upon for correctness. \ No newline at end of file