where $s is a local variable for status code (subject to change), and $1 is the command to be executed. This is a concise way to keep track of return codes, because most errors that can be encountered are not fatal to the script. This way, we can simply return $s from the end of both install and uninstall functions and the caller can handle the output.
Add intelligent error handling to scripts.
My current plan is to use the following function:
where $s is a local variable for status code (subject to change), and $1 is the command to be executed. This is a concise way to keep track of return codes, because most errors that can be encountered are not fatal to the script. This way, we can simply
return $s
from the end of both install and uninstall functions and the caller can handle the output.