mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
improvement to explanation.
@@ -16,7 +16,7 @@ trap 'echo "Finished on $(date)"' EXIT
|
||||
|
||||
With double quotes, all parameter and command expansions will expand when the trap is defined rather than when it's executed.
|
||||
|
||||
In the example, the message will contain the date on which the trap was declared, and not the date on which the script exits.
|
||||
In the example with the Problematic code, the message will contain the date on which the trap was declared, and not the date on which the script exits.
|
||||
|
||||
Using single quotes will prevent expansion at declaration time, and save it for execution time.
|
||||
|
||||
|
Reference in New Issue
Block a user