mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Add POSIX solution
11
SC2141.md
11
SC2141.md
@@ -11,6 +11,12 @@ IFS="\t"
|
||||
```sh
|
||||
IFS=$'\t'
|
||||
```
|
||||
or POSIX:
|
||||
|
||||
```sh
|
||||
IFS="$(printf '\t')"
|
||||
```
|
||||
|
||||
|
||||
### Rationale:
|
||||
|
||||
@@ -19,3 +25,8 @@ IFS=$'\t'
|
||||
### Exceptions
|
||||
|
||||
It's extremely rare to want to split on the letter "n" or "t", rather than linefeed or tab.
|
||||
|
||||
|
||||
### Related resources
|
||||
|
||||
See https://github.com/koalaman/shellcheck/wiki/SC1012
|
Reference in New Issue
Block a user