# çµäºå¦çï¼$1: ã·ã°ãã«åï¼ cleanup() { # çµäºå¦çä¸ã«ç¡è¦ããã·ã°ãã«ï¼ä»ã«å¿ è¦ãªå ´åã¯è¿½å ããï¼ trap '' HUP INT QUIT PIPE TERM # ããã«çµäºå¦çãæ¸ã : TODO # èªåèªèº«ã«ã·ã°ãã«ãåéä¿¡ãããã¨ã§ã·ã§ã«ã¹ã¯ãªãããçµäºãã trap - EXIT "$1" [ "$1" = EXIT ] || kill -s "$1" $$ || exit 1 } # ãã©ããããã·ã°ãã«ï¼ä»ã«å¿ è¦ãªå ´åã¯è¿½å ããï¼ for i in EXIT HUP INT QUIT PIPE TERM; do trap 'cleanup '"$i" "$i" done # ããããä¸ã«å®éã®ã·ã§ã«ã¹ã¯ãªããã®å 容ãæ¸ã : : èªåèªèº«ã«ã·ã°ãã«ãåéä¿¡ãã¦ããã¨ãããç¹å¾´çã ã¨æãã¾ããããã®çç±ã«ã¤ãã¦ã®è§£èª¬ããã®è¨äºã®å 容ã§ãPOSIX æºæ ã§
{{#tags}}- {{label}}
{{/tags}}