\tis just literal
there. For tab, use
# Want tab var=foo\tbar
# Want linefeed var=foo\nbar
var="foo$(printf '\t')bar" # As suggested in warning var="$(printf 'foo\tbar')" # Equivalent alternative
# Literal, quoted linefeed line="foo bar"
ShellCheck has found a
\r in a context where they just become regular letters
r. Most likely, it was intended as a tab, linefeed or carriage return.
To generate such characters (plus other less common ones including
\f and octal escapes) , use
printf as in the example. The exception is for linefeeds that would be stripped by command substitution; in these cases, use a literal quoted linefeed instead.
Other characters like
\z generate a SC1001 info message, as the intent is less certain.
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.