?? 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 $$."# 上邊這行展示了并沒有fork出子shell.echo "==================== Hit Ctl-C to exit ===================="sleep 1exec $0 # 產生了本腳本的另一個實例, #+ 但是這個新產生的實例卻代替了原來的實例.echo "This line will never echo!" # 為什么不是這樣?exit 0
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -