文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Shell: 用trap捕获ctrl+c信号的方法

Shell: 用trap捕获ctrl+c信号的方法

时间:2010-09-03  来源:haiwei_wu

ctrl+c 发的信号是2. 可以用kill -l查看所有受系统支持的信号。   trap 'echo "you fool, dont press ctr+c again!!!";sleep 10;exit' 2;   echo 前的"'"符号是单引号。   例子:   while true; do echo test; trap 'echo nonono; echo "you fool, dont press ctr+c again!!!";sleep 10;exit' 2; done   执行结果末尾N行:   test
test
test
test
test
test
test
test
test
test
test
test
tetest
test
test
nonono
you fool, dont press ctr+c again!!!
相关阅读 更多 +
排行榜 更多 +
天空决斗内置MOD菜单最新版本

天空决斗内置MOD菜单最新版本

飞行射击 下载
战斗大师2025最新版

战斗大师2025最新版

飞行射击 下载
战斗大师内置菜单

战斗大师内置菜单

飞行射击 下载