From f8979926f7f89781b6e708f6a8814f1604cc5253 Mon Sep 17 00:00:00 2001 From: wileyhy <84648683+wileyhy@users.noreply.github.com> Date: Sun, 6 Oct 2024 00:30:23 -0700 Subject: [PATCH] Change x5 more incidents of word "linefeed" for word "newline," as code reflects. --- SC1012.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SC1012.md b/SC1012.md index e7899fa..3daa3bc 100644 --- a/SC1012.md +++ b/SC1012.md @@ -32,7 +32,7 @@ $ printf '<%s>\n' "$var" or ```sh -# Literal, quoted linefeed +# Literal, quoted newline $ line="foo > bar" $ printf '<%s>\n' "$line" @@ -43,7 +43,7 @@ bar> or ```sh -# Linefeed using ANSI-C quoting +# Newline using ANSI-C quoting $ line=$'foo\nbar' $ printf '<%s>\n' "$line" ### Rationale: -ShellCheck has found a `\t`, `\n` or `\r` in a context where they just become regular letters `t`, `n` or `r`. Most likely, it was intended as a tab, linefeed or carriage return. +ShellCheck has found a `\t`, `\n` or `\r` in a context where they just become regular letters `t`, `n` or `r`. Most likely, it was intended as a tab, newline or carriage return. -To generate such characters (plus other less common ones including `\a`, `\f` and octal escapes) , use `printf` as in the example. The exception is for linefeeds that would be stripped by command substitution; in these cases, use a literal quoted linefeed instead. +To generate such characters (plus other less common ones including `\a`, `\f` and octal escapes) , use `printf` as in the example. The exception is for newliness that would be stripped by command substitution; in these cases, use a literal quoted newline instead. Other characters like `\z` generate a [[SC1001]] info message, as the intent is less certain.