Ineffective Variable Assignment Medium

When a variable is assigned immediately before a command, it only affects the environment of the executed command and not the current shell. To make the variable assignment effective for the current shell, separate the assignment and command execution into two lines or use a subshell for limited scope.

Detector ID
shell/ineffective-variable-assignment@v1.0
Category
Common Weakness Enumeration (CWE) external icon
-
Tags
-