From 9cf4fd70ab9204dd40231293b901a08fde4f463e Mon Sep 17 00:00:00 2001 From: John Gardner Date: Wed, 22 Dec 2021 16:59:19 +1100 Subject: [PATCH] Add highlighting, missing hyphens, and version string prefix --- SC1004.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SC1004.md b/SC1004.md index dbc2911..e58a51b 100644 --- a/SC1004.md +++ b/SC1004.md @@ -1,6 +1,6 @@ ## This backslash+linefeed is literal. Break outside single quotes if you just want to break the line. -(This warning was retired after 0.7.2 due to low signal-to-noise ratio) +(This warning was retired after v0.7.2 due to low signal-to-noise ratio) ### Problematic code: @@ -17,13 +17,13 @@ var='This is a long '\ ``` ### Rationale: -You have a single quoted string containing a backslash followed by a linefeed (newline). Unlike double quotes or unquoted strings, this has no special meaning. The string will contain a literal backslash and a linefeed. +You have a single-quoted string containing a backslash followed by a linefeed (newline). Unlike double-quotes or unquoted strings, this has no special meaning. The string will contain a literal backslash and a linefeed. If you wanted to break the line but not add a linefeed to the string, stop the single quote, break the line, and reopen it. This is demonstrated in the correct code. If you wanted to break the line and also include the linefeed as a literal, you don't need a backslash: -``` +```sh var='This is a multi-line string with an embedded linefeed' ``` @@ -31,4 +31,4 @@ with an embedded linefeed' ### Exceptions: -If you do want a string containing a literal backslash+linefeed combo, such as with `sed`, you can [[ignore]] this warning. \ No newline at end of file +If you do want a string containing a literal backslash+linefeed combo, such as with `sed`, you can [[ignore]] this warning.