On a regular basis I forget to add && shutdown -h now
to a long-running process. Is there any way to add a shutdown -h now
command after the first command was invoked? It is not intended to interrupt the ongoing process. Maybe it is possible to watch the PID?
There's no need to repeatedly run ps to list all processes and grep through the output. Background the process with ctrl-Z, then run
bg %1 ; wait %1 ; shutdown -h now
If you have other background jobs running, then you will be given a different jobspec instead of [1] when you ctrl-z. If so, use that instead.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加