Bash - Exit parent script from child script

后端 未结 5 1727
盖世英雄少女心
盖世英雄少女心 2020-12-16 13:34

I have a Bash parent script that on unexpected input calls an error logging child script that logs the error. I also want the execution to halt when the error occurs and th

5条回答
  •  隐瞒了意图╮
    2020-12-16 14:14

    Extension to @anishsane comment because MacOS has little bit different ps syntax.

    Finding parent process ID (ppid) in child script under Mac OS (Darwin):

    kill -SIGUSR1 $(ps $$ -o ppid=);exit

提交回复
热议问题