How can I add to a already running process an additional 'shutdown' command?

brubaker

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?

psusi

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]

編集
0

コメントを追加

0

関連記事

分類Dev

How to check the process is already running or not

分類Dev

How can I know the absolute path of a running process?

分類Dev

How can i add extra flags while running make?

分類Dev

How can I add additional items to a store array and still be able to set the array to empty when resetting?

分類Dev

How can I add the additional information below file icons in OS X?

分類Dev

How can I add options to a custom made command?

分類Dev

How can I create a file in Linux in a way that when I open it, it is actually running a process

分類Dev

How can I add another table to the database if there are already several tables in Android?

分類Dev

Django-HTML: How can i allow users to add additional input fields (ensuring they are not required)? Something like a + button

分類Dev

How can I make shutdown work properly with this custom ExecutorService?

分類Dev

How can I make running a command depend on the input of a correct password (Tkinter GUI)?

分類Dev

How can I assign a literal tab "\t" to a variable and interpret it only when I add it as a delimiter to the sort command?

分類Dev

How can I fix Sportsdevil add-on in XBMC running on Ubuntu 13.04?

分類Dev

How can I add a new data partition on Mac with splitting the main partition in two parts? Windows 7 is already installed with bootcamp

分類Dev

How can I use an additional xsd with python zeep?

分類Dev

How can I get some additional information from an EF DbUpdateException

分類Dev

How can I create additional users in Ubuntu OpenStack?

分類Dev

How can I start a process using cpulimit?

分類Dev

How can i terminate process created with winexec()?

分類Dev

How to add additional values in to array

分類Dev

How can I know whether a JobScheduler is running?

分類Dev

How can I see what processes are running?

分類Dev

How to hide a running process ?

分類Dev

How can I check whether a option already exist in select by JQuery

分類Dev

How can I edit the region of an aws lambda function already created?

分類Dev

How can I get the data from div already divided

分類Dev

How can I check if an iptables rule already exists?

分類Dev

How to add new co-routine to already running loop in Python asyncio?

分類Dev

Can I add an additional hdd with a new windows 7 install to and exisiting ubunbtu 14.04 LTS PC

Related 関連記事

  1. 1

    How to check the process is already running or not

  2. 2

    How can I know the absolute path of a running process?

  3. 3

    How can i add extra flags while running make?

  4. 4

    How can I add additional items to a store array and still be able to set the array to empty when resetting?

  5. 5

    How can I add the additional information below file icons in OS X?

  6. 6

    How can I add options to a custom made command?

  7. 7

    How can I create a file in Linux in a way that when I open it, it is actually running a process

  8. 8

    How can I add another table to the database if there are already several tables in Android?

  9. 9

    Django-HTML: How can i allow users to add additional input fields (ensuring they are not required)? Something like a + button

  10. 10

    How can I make shutdown work properly with this custom ExecutorService?

  11. 11

    How can I make running a command depend on the input of a correct password (Tkinter GUI)?

  12. 12

    How can I assign a literal tab "\t" to a variable and interpret it only when I add it as a delimiter to the sort command?

  13. 13

    How can I fix Sportsdevil add-on in XBMC running on Ubuntu 13.04?

  14. 14

    How can I add a new data partition on Mac with splitting the main partition in two parts? Windows 7 is already installed with bootcamp

  15. 15

    How can I use an additional xsd with python zeep?

  16. 16

    How can I get some additional information from an EF DbUpdateException

  17. 17

    How can I create additional users in Ubuntu OpenStack?

  18. 18

    How can I start a process using cpulimit?

  19. 19

    How can i terminate process created with winexec()?

  20. 20

    How to add additional values in to array

  21. 21

    How can I know whether a JobScheduler is running?

  22. 22

    How can I see what processes are running?

  23. 23

    How to hide a running process ?

  24. 24

    How can I check whether a option already exist in select by JQuery

  25. 25

    How can I edit the region of an aws lambda function already created?

  26. 26

    How can I get the data from div already divided

  27. 27

    How can I check if an iptables rule already exists?

  28. 28

    How to add new co-routine to already running loop in Python asyncio?

  29. 29

    Can I add an additional hdd with a new windows 7 install to and exisiting ubunbtu 14.04 LTS PC

ホットタグ

アーカイブ