Article 5411D Shutdown PC after command is done?

Shutdown PC after command is done?

by
ddenial
from LinuxQuestions.org on (#5411D)
Hello All

Is there a way to shutdown PC after the existing command is done executing?

I have this shell script which takes one or more hours to finish. Sometimes in the middle of the runtime, I have to leave PC and go out for other work. I have a dilemma - should I cancel the running process by Ctrl+C and shutdown PC or just leave it running. Most of the time I return after several hours, in this time the PC would be sitting there idle consuming power after it has finished the command.

So my question - Is there a way to append like '&& systemctl shutdown' to existing command/process which is already executing?

Thankslatest?d=yIl2AUoC8zA latest?i=6m_YIrYdpU4:npDZuj8t3aA:F7zBnMy latest?i=6m_YIrYdpU4:npDZuj8t3aA:V_sGLiP latest?d=qj6IDK7rITs latest?i=6m_YIrYdpU4:npDZuj8t3aA:gIN9vFw6m_YIrYdpU4
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments