SC2250 – ShellCheck Wiki

See this page on GitHub


Prefer putting braces around variable references even when not strictly required.

This is an optional suggestion. It must be explicitly enabled with a directive enable=require-variable-braces in a # shellcheck comment or .shellcheckrc

Problematic code:


curl "$partial_path_version/explain.html"

Correct code:


curl "${partial_path}_version/explain.html"


If a variable gets called, and there is a string that gets appended to the variable that could get misinterpreted as possibly part of the name of the variable. Then it will not call the right variable.

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