I want to create a sh script that runs python script python core.py and when the script is finished pause for some milliseconds and run it again. And so on and on. Not sure where to start - any help appreciated.
Asked
Active
Viewed 34 times
0
John T
- 101
- 1
-
I am not sure Watch waits for the python script to complete, so maybe not – John T Jul 30 '21 at 17:28
-
1Note that although the minimum time unit in GNU `sleep` is the second, it does permit fractional values ex. `0.0xy` for xy milliseconds. So you can use a simple `while ... sleep` loop as in [this answer](https://askubuntu.com/a/1254081/178692) – steeldriver Jul 30 '21 at 17:28
-
Yes but it says nothing about the command being complete before running again. I can not guess the sleep time, it will vary much. – John T Jul 30 '21 at 17:35
-
1@JohnT As mentioned in the answers of [this U&L question](https://unix.stackexchange.com/questions/403537/what-happens-in-watch-when-the-called-command-has-not-yet-finished), `wacth` waits until the command is finished before running it again after the specified time interval. – BeastOfCaerbannog Jul 30 '21 at 17:51
-
Great! I will test it ASAP and get back here. – John T Jul 30 '21 at 18:16