linux zsh you have running jobs

Posted in :

在透過 & 符號, 隨手執行了一個 python 背景程式, 想退出目前 ssh 登入狀況, 下 quit 或 exit 都退不出來,

解法: 使用 &!
https://stackoverflow.com/questions/19302913/exit-zsh-but-leave-running-jobs-open

Start the program with &!:

dolphin &!

The &! (or equivalently, &|) is a zsh-specific shortcut to both background and disown the process, such that exiting the shell will leave it running.


附註: 這是 zsh 才會遇到, 如果你是使用其他的 shell, 使用 &! 反而會顯示錯誤訊息.

Syntax error: newline unexpected

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *