How to plan a task to run after another already running task in bash?

czerny

I'm looking for something like command1 ; command2 i.e. how to run command2 after command1 but I'd like to plan execution of command2 when command1 is already running.

It can be solved by just typing the command2 and confirming by Enter supposed that the command1 is not consuming standard input and that the command1 doesn't produce to much text on output making it impractical to type (typed characters are blended with the command1 output).

The Guy with The Hat

Generally what I do is: Ctrl+Z fg && command2

  1. Ctrl+Z to pause it and let you type more in the shell.
  2. Optionally bg, to resume command1 in the background while you type out command2.
  3. fg && command2 to resume command1 in the foreground and queue up command2 afterwards if command1 succeeds. You can of course substitute ; or || for the && if you so desire.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Running another Task after first Task

From Dev

Check Task.Run Is Not Already Running

From Dev

How to run gradle task after another task, even the last task has dependecies which are failed

From Dev

How to run gradle task after another task, even the last task has dependecies which are failed

From Dev

Cancelling a already running task

From Dev

How to run a task after another using taskGraph.whenReady closure

From Dev

Run one rake task after another completes

From Dev

How to make a task complete before running another task

From Dev

How to run a task before running tests

From Dev

Linkedin parseq. How to run task after task?

From Dev

Windows Task Scheduler - Schedule a Task to Run 15 Minutes After another Task Completes

From Dev

Run grunt task asynchronously before another task

From Java

Run task from another periodic task with celery

From Dev

Windows Task Scheduler, run task if task isn't running?

From Dev

Run another task after executing one function successfully Using Celery

From Dev

Run task while application is running

From Dev

Run gulp task after completion of other task

From Dev

How to run a custom task(functional tests written in protractor) while the "run" task is up and running?

From Dev

Ensuring a Gradle task is executed after another task

From Dev

Running bash commands in Ansible task

From Dev

Check if task is already running before starting new

From Dev

Task launch failed, instance already running

From Dev

Running async task after activitiy

From Dev

Run rake task in another directory

From Dev

How to run a window into a new task and keep its main thread running

From Dev

How to run a task once every Threads finished running in Java?

From Dev

How to run a window into a new task and keep its main thread running

From Dev

How to get running programs of task manager of another computer

From Dev

How to Update UI while a task is running in another thread in android?

Related Related

  1. 1

    Running another Task after first Task

  2. 2

    Check Task.Run Is Not Already Running

  3. 3

    How to run gradle task after another task, even the last task has dependecies which are failed

  4. 4

    How to run gradle task after another task, even the last task has dependecies which are failed

  5. 5

    Cancelling a already running task

  6. 6

    How to run a task after another using taskGraph.whenReady closure

  7. 7

    Run one rake task after another completes

  8. 8

    How to make a task complete before running another task

  9. 9

    How to run a task before running tests

  10. 10

    Linkedin parseq. How to run task after task?

  11. 11

    Windows Task Scheduler - Schedule a Task to Run 15 Minutes After another Task Completes

  12. 12

    Run grunt task asynchronously before another task

  13. 13

    Run task from another periodic task with celery

  14. 14

    Windows Task Scheduler, run task if task isn't running?

  15. 15

    Run another task after executing one function successfully Using Celery

  16. 16

    Run task while application is running

  17. 17

    Run gulp task after completion of other task

  18. 18

    How to run a custom task(functional tests written in protractor) while the "run" task is up and running?

  19. 19

    Ensuring a Gradle task is executed after another task

  20. 20

    Running bash commands in Ansible task

  21. 21

    Check if task is already running before starting new

  22. 22

    Task launch failed, instance already running

  23. 23

    Running async task after activitiy

  24. 24

    Run rake task in another directory

  25. 25

    How to run a window into a new task and keep its main thread running

  26. 26

    How to run a task once every Threads finished running in Java?

  27. 27

    How to run a window into a new task and keep its main thread running

  28. 28

    How to get running programs of task manager of another computer

  29. 29

    How to Update UI while a task is running in another thread in android?

HotTag

Archive