ex76.sh
来自「Shall高级编程」· Shell 代码 · 共 21 行
SH
21 行
#!/bin/bash# Hunting variables with a trap.trap 'echo Variable Listing --- a = $a b = $b' EXIT# EXIT is the name of the signal generated upon exit from a script.## The command specified by the "trap" doesn't execute until#+ the appropriate signal is sent.echo "This prints before the \"trap\" --"echo "even though the script sees the \"trap\" first."echoa=39b=36exit 0# Note that commenting out the 'exit' command makes no difference,#+ since the script exits in any case after running out of commands.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?