Guest User

Untitled

a guest
Aug 17th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. Kill process when father process ends with Control C
  2. SIGINT=2
  3. trap 'clean_exit' $SIGINT
  4. # other thgs in your main prog
  5. function clean_exit(){
  6. # define SIGTERM and your $pid according to your need
  7. kill -$SIGTERM $pid
  8. #other things to do
  9. }
Add Comment
Please, Sign In to add comment