add new chinese translations
This commit is contained in:
20
pages.zh/linux/trap.md
Normal file
20
pages.zh/linux/trap.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# trap
|
||||
|
||||
> 在事件发生时执行命令。
|
||||
> 更多信息:<https://www.gnu.org/software/bash/manual/bash.html#index-trap>。
|
||||
|
||||
- 列出可用的事件名称(例如 `SIGWINCH`):
|
||||
|
||||
`trap -l`
|
||||
|
||||
- 列出命令和预期事件的名称:
|
||||
|
||||
`trap -p`
|
||||
|
||||
- 在接收到信号时执行命令:
|
||||
|
||||
`trap 'echo "捕获信号 {{SIGHUP}}"' {{SIGHUP}}`
|
||||
|
||||
- 移除命令:
|
||||
|
||||
`trap - {{SIGHUP}} {{SIGINT}}`
|
Reference in New Issue
Block a user