It's easy to detect when a shell script starts, but it's not always easy to know when it stops. A script might end normally, just as its author intends it to end, but it could also fail due to an unexpected fatal error. Sometimes it's beneficial to preserve the remnants of whatever was in progress when a script failed, and other times it's inconvenient. Either way, detecting the end of a script and reacting to it in some pre-calculated manner is why the Bash trap
directive exists.
read more
from Opensource.com https://ift.tt/2NG1yOS
No comments:
Post a Comment
Please do not enter any spam link in the comment box.