开发者

Building a delay and loop in cygwin cmdline

开发者 https://www.devze.com 2023-03-26 12:45 出处:网络
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

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 pa开发者_开发技巧ckage for cygwin since that's more efficient.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消