mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-08-03 20:35:32 +02:00
trap: add Chinese translation
This commit is contained in:
parent
21fece70d6
commit
365572cacf
1 changed files with 20 additions and 0 deletions
20
pages.zh/osx/trap.md
Normal file
20
pages.zh/osx/trap.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# trap
|
||||
|
||||
> 在进程或操作系统接收到信号后自动执行命令.
|
||||
> 可用于对用户中断或其他操作执行清理.
|
||||
|
||||
- 列出设置 trap 的可用信号:
|
||||
|
||||
`trap -l`
|
||||
|
||||
- 列出当前 shell 程序的活动 trap 程序:
|
||||
|
||||
`trap -p`
|
||||
|
||||
- 设置 trap 以在检测到一个或多个信号时执行命令:
|
||||
|
||||
`trap 'echo "检测到信号 {{SIGHUP}}"' {{SIGHUP}}`
|
||||
|
||||
- 移除活动 trap:
|
||||
|
||||
`trap - {{SIGHUP}} {{SIGINT}}`
|
Loading…
Add table
Reference in a new issue