mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2097 (markdown)
@@ -18,7 +18,7 @@ To prevent setting the variable, this can also be done in a subshell:
|
||||
|
||||
### Rationale:
|
||||
|
||||
In `name=World cmd "$name"`, `name=World` is passed in as part of the environment to `cmd` (i.e., in the `envp` parameter to [man 2 execve](http://linux.die.net/man/2/execve)). This means that `cmd` and its children will see the parameter, but no other processes will.
|
||||
In `name=World cmd "$name"`, `name=World` is passed in as part of the environment to `cmd` (i.e., in the `envp` parameter to [execve(2)](http://linux.die.net/man/2/execve)). This means that `cmd` and its children will see the parameter, but no other processes will.
|
||||
|
||||
However, `"$name"` is not expanded by `cmd`. `"$name"` is expanded by the shell before `cmd` is ever executed, and thus it will not use the new value.
|
||||
|
||||
|
Reference in New Issue
Block a user