📄 self-exec.sh
字号:
#!/bin/bash# self-exec.shechoecho "This line appears ONCE in the script, yet it keeps echoing."echo "The PID of this instance of the script is still $$."# Demonstrates that a subshell is not forked off.echo "==================== Hit Ctl-C to exit ===================="sleep 1exec $0 # Spawns another instance of this same script #+ that replaces the previous one.echo "This line will never echo!" # Why not?exit 99 # Will not exit here! # Exit code will not be 99!
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -