SC2141 – ShellCheck Wiki

See this page on GitHub

Sitemap


Did you mean IFS=$'\t' ?

Problematic code:

IFS="\t"

Correct code:

IFS=$'\t'

or POSIX:

IFS="$(printf '\t')"

Rationale:

IFS="\t" splits on backslash and the letter "t". IFS=$'\t' splits on tab.

Exceptions

It's extremely rare to want to split on the letter "n" or "t", rather than linefeed or tab.

See https://github.com/koalaman/shellcheck/wiki/SC1012


ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.