mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Add Heredoc section
15
SC2039.md
15
SC2039.md
@@ -251,6 +251,21 @@ command > file 2>&1 or command 2>&1 | othercommand
|
|||||||
|
|
||||||
No Comments / Exceptions
|
No Comments / Exceptions
|
||||||
|
|
||||||
|
### Heredoc
|
||||||
|
|
||||||
|
Change:
|
||||||
|
```
|
||||||
|
sed 's/some_replacement//g' <<< "${var}"
|
||||||
|
```
|
||||||
|
|
||||||
|
To:
|
||||||
|
```
|
||||||
|
printf '%s' "${var}" | sed 's/some_replacement//g'
|
||||||
|
```
|
||||||
|
|
||||||
|
No Comments / Exceptions
|
||||||
|
|
||||||
|
|
||||||
## Exception
|
## Exception
|
||||||
|
|
||||||
Depends on what your expected POSIX shell providers would use.
|
Depends on what your expected POSIX shell providers would use.
|
Reference in New Issue
Block a user