improvement to explanation.

©TriMoon™
2021-03-13 14:27:02 +03:00
parent 7234f6235c
commit ad1e7d25d5

@@ -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.