Kay
Kay

Reputation: 845

Terminal Run Code for n seconds

I've searched for this, but haven't found a single command yet - how would i run say hello.o for n amount of seconds on the terminal.?

Upvotes: 0

Views: 365

Answers (1)

ghostdog74
ghostdog74

Reputation: 343107

 watch -n 60 hello.o

If you want to run hello.o for n number of seconds for X number of times

x=0
n=60
while [ "$x" -lt 10 ]; do ./hello.o; ((x++));sleep $n; done

Upvotes: 1

Related Questions