SC3053 – ShellCheck Wiki

See this page on GitHub


In POSIX sh, indirect expansion is undefined.

(or "In dash, ... is not supported." when using dash)

Problematic code:

echo "${!name}"

Correct code:

The easiest solution is to switch to a shell that does support indirect expansion, like bash:

echo "${!name}"

Alternatively, carefully rewrite using eval:

eval "echo \"\$$name\""


Indirection expansion is an extension in bash and ksh, and not supported in dash or POSIX sh. Either switch to a shell that supports them, or write around it with careful use of eval. Take care to validate the variable name to avoid fragility and code injection.


If you only intend to target shells that supports this feature, you can change the shebang to a shell that guarantees support, or ignore this warning.

You can use # shellcheck disable=SC3000-SC4000 to ignore all such compatibility warnings.

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