Advertisement
Guest User

Untitled

a guest
Aug 25th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # SIGHUP, SIGINT SIGTERM 시그널이 발생하면 cleanup 함수 실행
  4. trap "cleanup; exit" SIGHUP SIGINT SIGTERM
  5.  
  6. function cleanup() {
  7. echo "SIGNAL input"
  8. }
  9.  
  10. # 무한 루프 중 시그널이 발생하면 종료
  11. while [[ 1=1 ]]; do
  12. sleep 10
  13. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement