How can I pipe command output to a pause command, which defers execution for a given length of time?

StackOverflow https://stackoverflow.com/questions/4339805

  •  30-09-2019
  •  | 
  •  

Question

Is it possible to do something like this in unix?

monit restart | pause 120 | monit status

I just happen to be monitoring monit which restarts and then i find myself repeatedly outputting the status until I see the change I am looking for in the status. This won't happen until exactly 2 minutes later.

So I just wondered if there was a way to defer a unix command to happen after some time period. Anything built in would be better, but if writing some utility script is the only way, then that's cool too.

Thanks!

Was it helpful?

Solution

monit restart && sleep 120 && monit status

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top