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) ;)


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -