Search code examples
loopscygwindelay

Building a delay and loop in cygwin cmdline


I'm trying to build a delay and loop into my cygwin command line. Is this possible and if so, how?

I don't think I can be more specific without getting into much irrelevant details. However, if you want additional information, do let me know.

/edit/

I installed default cygwin with some additional stuff: wget most importantly. I am trying to loop a wget commandline each x minutes/hours/days. It is merely logging in to a website.

I am using mintty

/edit2/

Getting the cron package for cygwin since that's more efficient.


Solution

  • You can do it as a shell script, or write this on the bash command prompt to perform an infinite loop with a 1 second delay:

    while true; do echo "hello"; sleep 1; done
    

    So with wget you would do:

    while true; do wget ...; sleep 1; done
    

    To add more delay just change the number after sleep.