shell trap命令

#!/bin/bash
trap "rm server;kill 0" EXIT

trap 命令用于在 shell 脚本退出时,删掉临时文件,结束子进程。


可以捕捉信号

评论