Bash - Exit parent script from child script -
i have bash parent script on unexpected input calls error logging child script logs error. want execution halt when error occurs , error script called. if call exit
error handling script not stop parent script executing. how may go stopping parent script child?
try..
#normal flow [[ $(check_error_condition ]] && /some/error_reporter.sh || exit 1
so,
- when error_reporter exit exit status > 0 parent terminate too
- if error_reporter exit status = 0 parent continues...
you don't want stop parent child
(the parents don't behavior) :), instead want tell parent - need stop
, stop (if want) ;)