mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Add an additional and different example of correct syntax using ANSI-C quoting.
@@ -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.
|
||||
|
Reference in New Issue
Block a user