Pattern: Translated string is the name of variable
Issue: -
$".."
is a localized string, for example, echo $"Hello $USER"
along with the proper translation files can be used to have the script say "Bonjour, youruser" in French locales.
In this case, ShellCheck found a localized string whose contents is also the name of a variable. This could have happened because the user wanted a far more common quoted substitution, e.g. "$var"
, but accidentally switched the leading $
and "
.
Example of incorrect code:
var="foo"
echo $"var"
Example of correct code:
var="foo"
echo "$var"