Using Bash traps in your scripts
@uselinux
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

@uselinux

source
Opensource.com
(Posted by bob on Jun 29, 2020 8:45 PM EDT)
#auto_post

Comments

Be the first to add a comment