Multiple commands, but not at the same time

Mathias711

I want to execute 4 different files in the background with python, but not simultaneous. There should be ~5 seconds between each evaluation, but I can't get it to work. I tried:

python cmd1 &; sleep 5; python cmd2 &; sleep 5; python cmd3 &; sleep 5; python cmd4 &

But only the first file is executed before the rest. The other three are evaluated at the same time. Then I tried with a double ampersand after each sleep:

python cmd1 &; sleep 5 && python cmd2 &; sleep 5 && python cmd3 &; sleep 5 && python cmd4 &

So that each python command would wait until the sleep is done, but that didn't work either. How can I get this to work?

unlink

Use parentheses: (sleep 5; python cmd1 &); (sleep 10; python cmd2 &)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do you run Multiple XMLA Alter Commands at the same time?

From Dev

execute multiple commands in Linux using python in the same time

From Dev

javascript multiple commands on the same object

From Dev

Multiple commands same CMD window

From Dev

Time multiple commands without a subshell?

From Dev

how to use ssh command to connect to multiple computers and send different commands to each computers at same time

From Dev

How to run multiple command in one line and some commands in background at the same time?

From Dev

Multiple cronjobs at the same time

From Dev

Run two commands at the same time in Elm

From Dev

Python - run two commands at the same time

From Dev

Python - run two commands at the same time

From Dev

Invoking two commands at the same time powershell

From Dev

How to use multiple 'commands' in the same function in Haskell

From Dev

Bash executing multiple commands in background in same line

From Dev

Run Multiple Exec Commands in the same shell golang

From Dev

xargs : using same argument in multiple commands

From Dev

Save output of multiple commands to the same file

From Dev

Python multiple loops at the same time

From Dev

Start multiple ViewPropertyAnimators at the same time

From Dev

AngularJS - Multiple keypress at the same time

From Dev

Support multiple languages at the same time?

From Dev

Multiple ajax requests at the same time

From Dev

Scroll multiple div at the same time

From Dev

Rotate multiple elements at the same time

From Dev

Search multiple HashMaps at the same time

From Dev

Finishing multiple animations in the same time

From Dev

Server multiple tabs at the same time

From Dev

Running multiple functions at the same time

From Dev

Rename multiple files at the same time

Related Related

  1. 1

    How do you run Multiple XMLA Alter Commands at the same time?

  2. 2

    execute multiple commands in Linux using python in the same time

  3. 3

    javascript multiple commands on the same object

  4. 4

    Multiple commands same CMD window

  5. 5

    Time multiple commands without a subshell?

  6. 6

    how to use ssh command to connect to multiple computers and send different commands to each computers at same time

  7. 7

    How to run multiple command in one line and some commands in background at the same time?

  8. 8

    Multiple cronjobs at the same time

  9. 9

    Run two commands at the same time in Elm

  10. 10

    Python - run two commands at the same time

  11. 11

    Python - run two commands at the same time

  12. 12

    Invoking two commands at the same time powershell

  13. 13

    How to use multiple 'commands' in the same function in Haskell

  14. 14

    Bash executing multiple commands in background in same line

  15. 15

    Run Multiple Exec Commands in the same shell golang

  16. 16

    xargs : using same argument in multiple commands

  17. 17

    Save output of multiple commands to the same file

  18. 18

    Python multiple loops at the same time

  19. 19

    Start multiple ViewPropertyAnimators at the same time

  20. 20

    AngularJS - Multiple keypress at the same time

  21. 21

    Support multiple languages at the same time?

  22. 22

    Multiple ajax requests at the same time

  23. 23

    Scroll multiple div at the same time

  24. 24

    Rotate multiple elements at the same time

  25. 25

    Search multiple HashMaps at the same time

  26. 26

    Finishing multiple animations in the same time

  27. 27

    Server multiple tabs at the same time

  28. 28

    Running multiple functions at the same time

  29. 29

    Rename multiple files at the same time

HotTag

Archive