mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC2141 (markdown)
17
SC2141.md
Normal file
17
SC2141.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
## Did you mean IFS=$'\t' ?
|
||||||
|
|
||||||
|
### Problematic code:
|
||||||
|
|
||||||
|
IFS="\t"
|
||||||
|
|
||||||
|
### Correct code:
|
||||||
|
|
||||||
|
IFS=$'\t'
|
||||||
|
|
||||||
|
### Rationale:
|
||||||
|
|
||||||
|
`IFS="\t"` splits on backslash and the letter "t". `IFS=$'\t'` splits on tab.
|
||||||
|
|
||||||
|
### Contraindications
|
||||||
|
|
||||||
|
It's extremely rare to want to split on the letter "n" or "t", rather than linefeed or tab.
|
Reference in New Issue
Block a user