From a398b93a34c7465a886a3b647b61bf15f7c09c25 Mon Sep 17 00:00:00 2001 From: wileyhy <84648683+wileyhy@users.noreply.github.com> Date: Sun, 6 Oct 2024 00:21:27 -0700 Subject: [PATCH] Add an additional and different example of correct syntax using ANSI-C quoting. --- SC1012.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SC1012.md b/SC1012.md index 618ae45..2eaaa04 100644 --- a/SC1012.md +++ b/SC1012.md @@ -29,6 +29,14 @@ line="foo bar" ``` +or + +```sh +# Linefeed using ANSI-C quoting +line=$'foo\nbar' +``` + + ### 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.