Clean up vertical whitespace

John Gardner
2021-12-22 18:34:38 +11:00
parent d0ad188871
commit d5b4de98fc

@@ -22,14 +22,16 @@ var="$(printf 'foo\tbar')" # Equivalent alternative
```
or
```sh
# Literal, quoted linefeed
line="foo
bar"
```
### Rationale:
ShellCheck has found a `\t`, `\n` or `\r` in a context where they just become regular letter `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, linefeed 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.