mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Clean up vertical whitespace
@@ -22,14 +22,16 @@ var="$(printf 'foo\tbar')" # Equivalent alternative
|
|||||||
```
|
```
|
||||||
|
|
||||||
or
|
or
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Literal, quoted linefeed
|
# Literal, quoted linefeed
|
||||||
line="foo
|
line="foo
|
||||||
bar"
|
bar"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Rationale:
|
### 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.
|
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.
|
||||||
|
|
||||||
@@ -41,4 +43,4 @@ None.
|
|||||||
|
|
||||||
### Related resources:
|
### Related resources:
|
||||||
|
|
||||||
* Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!
|
* Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!
|
||||||
|
Reference in New Issue
Block a user