You are viewing a single comment's thread from:

RE: Linux Automation Tip: Repeat Commands with Loops and Delays

in #making8 years ago

Beautiful. But maybe it's better to do it in Python?

import time
import sys

##
##code_def()
##

if __name__ == '__main__':

    delay, loops = sys.argv[1], sys.argv[2]

    for loop in range(loops):
        code_def()
        time.sleep(delay)
    

python app.py 10 2
Sort:  

I think it depends how much you will be using built-in linux commands versus coding, either way works :)