How to pause loop after x loops for x seconds [duplicate]2019 Community Moderator ElectionHow do I pause my shell script for a second before continuing?Bash: limit the number of concurrent jobs?How to check if a string contains a substring in BashHow to check if a program exists from a Bash script?How do I tell if a regular file does not exist in Bash?How do I split a string on a delimiter in Bash?How to concatenate string variables in BashHow to reload .bash_profile from the command line?How to set a variable to the output of a command in Bash?Loop through an array of strings in Bash?Read a file line by line assigning the value to a variableHow do I pause my shell script for a second before continuing?

Can other pieces capture a threatening piece and prevent a checkmate?

Is it possible to stack the damage done by the Absorb Elements spell?

Describing a chess game in a novel

Brake pads destroying wheels

Are dual Irish/British citizens bound by the 90/180 day rule when travelling in the EU after Brexit?

Recruiter wants very extensive technical details about all of my previous work

Maths symbols and unicode-math input inside siunitx commands

If "dar" means "to give", what does "daros" mean?

What exactly term 'companion plants' means?

Bash - pair each line of file

What does "Four-F." mean?

Is it insecure to send a password in a `curl` command?

Asserting that Atheism and Theism are both faith based positions

Practical application of matrices and determinants

Can a medieval gyroplane be built?

Is honey really a supersaturated solution? Does heating to un-crystalize redissolve it or melt it?

Existence of a celestial body big enough for early civilization to be thought of as a second moon

How are passwords stolen from companies if they only store hashes?

What does Deadpool mean by "left the house in that shirt"?

Why didn't Héctor fade away after this character died in the movie Coco?

How to get the n-th line after a grepped one?

Unfrosted light bulb

How does 取材で訪れた integrate into this sentence?

I got the following comment from a reputed math journal. What does it mean?



How to pause loop after x loops for x seconds [duplicate]



2019 Community Moderator ElectionHow do I pause my shell script for a second before continuing?Bash: limit the number of concurrent jobs?How to check if a string contains a substring in BashHow to check if a program exists from a Bash script?How do I tell if a regular file does not exist in Bash?How do I split a string on a delimiter in Bash?How to concatenate string variables in BashHow to reload .bash_profile from the command line?How to set a variable to the output of a command in Bash?Loop through an array of strings in Bash?Read a file line by line assigning the value to a variableHow do I pause my shell script for a second before continuing?










-3
















This question already has an answer here:



  • How do I pause my shell script for a second before continuing?

    8 answers



How can I pause my loop after x loops for x seconds?



My loop reads a list of IP addresses line by line. After 50 loops it should pause x seconds till the loop continues.










share|improve this question













marked as duplicate by Jonny Henly, Zoe, chepner, tripleee bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 8 at 5:41


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















  • Nope...it is not a duplicate of this questions.

    – user3022917
    Mar 7 at 17:20






  • 1





    sleep $x should do it.

    – Mark Setchell
    Mar 7 at 17:23











  • After 50 loops...

    – user3022917
    Mar 7 at 17:25











  • So you want us to write the script for you, instead of you searching Google how to use a loop with a counter and a conditional.

    – Jonny Henly
    Mar 7 at 17:29












  • Maybe see also stackoverflow.com/questions/1537956/…

    – tripleee
    Mar 8 at 5:42















-3
















This question already has an answer here:



  • How do I pause my shell script for a second before continuing?

    8 answers



How can I pause my loop after x loops for x seconds?



My loop reads a list of IP addresses line by line. After 50 loops it should pause x seconds till the loop continues.










share|improve this question













marked as duplicate by Jonny Henly, Zoe, chepner, tripleee bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 8 at 5:41


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















  • Nope...it is not a duplicate of this questions.

    – user3022917
    Mar 7 at 17:20






  • 1





    sleep $x should do it.

    – Mark Setchell
    Mar 7 at 17:23











  • After 50 loops...

    – user3022917
    Mar 7 at 17:25











  • So you want us to write the script for you, instead of you searching Google how to use a loop with a counter and a conditional.

    – Jonny Henly
    Mar 7 at 17:29












  • Maybe see also stackoverflow.com/questions/1537956/…

    – tripleee
    Mar 8 at 5:42













-3












-3








-3


0







This question already has an answer here:



  • How do I pause my shell script for a second before continuing?

    8 answers



How can I pause my loop after x loops for x seconds?



My loop reads a list of IP addresses line by line. After 50 loops it should pause x seconds till the loop continues.










share|improve this question















This question already has an answer here:



  • How do I pause my shell script for a second before continuing?

    8 answers



How can I pause my loop after x loops for x seconds?



My loop reads a list of IP addresses line by line. After 50 loops it should pause x seconds till the loop continues.





This question already has an answer here:



  • How do I pause my shell script for a second before continuing?

    8 answers







bash






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 7 at 17:12









user3022917user3022917

1721215




1721215




marked as duplicate by Jonny Henly, Zoe, chepner, tripleee bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 8 at 5:41


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Jonny Henly, Zoe, chepner, tripleee bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 8 at 5:41


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Nope...it is not a duplicate of this questions.

    – user3022917
    Mar 7 at 17:20






  • 1





    sleep $x should do it.

    – Mark Setchell
    Mar 7 at 17:23











  • After 50 loops...

    – user3022917
    Mar 7 at 17:25











  • So you want us to write the script for you, instead of you searching Google how to use a loop with a counter and a conditional.

    – Jonny Henly
    Mar 7 at 17:29












  • Maybe see also stackoverflow.com/questions/1537956/…

    – tripleee
    Mar 8 at 5:42

















  • Nope...it is not a duplicate of this questions.

    – user3022917
    Mar 7 at 17:20






  • 1





    sleep $x should do it.

    – Mark Setchell
    Mar 7 at 17:23











  • After 50 loops...

    – user3022917
    Mar 7 at 17:25











  • So you want us to write the script for you, instead of you searching Google how to use a loop with a counter and a conditional.

    – Jonny Henly
    Mar 7 at 17:29












  • Maybe see also stackoverflow.com/questions/1537956/…

    – tripleee
    Mar 8 at 5:42
















Nope...it is not a duplicate of this questions.

– user3022917
Mar 7 at 17:20





Nope...it is not a duplicate of this questions.

– user3022917
Mar 7 at 17:20




1




1





sleep $x should do it.

– Mark Setchell
Mar 7 at 17:23





sleep $x should do it.

– Mark Setchell
Mar 7 at 17:23













After 50 loops...

– user3022917
Mar 7 at 17:25





After 50 loops...

– user3022917
Mar 7 at 17:25













So you want us to write the script for you, instead of you searching Google how to use a loop with a counter and a conditional.

– Jonny Henly
Mar 7 at 17:29






So you want us to write the script for you, instead of you searching Google how to use a loop with a counter and a conditional.

– Jonny Henly
Mar 7 at 17:29














Maybe see also stackoverflow.com/questions/1537956/…

– tripleee
Mar 8 at 5:42





Maybe see also stackoverflow.com/questions/1537956/…

– tripleee
Mar 8 at 5:42












1 Answer
1






active

oldest

votes


















0














while read IP
do
<command>

# Sleep
((c++)) && ((c==50)) && sleep 60

done < input_file.txt





share|improve this answer


















  • 1





    You can put the && inside a single ((...)) statement. (( c++ && c == 50)). However, do you want to pause again after another 50 lines? You need to reset the value of c to 0. An explicit if statement is probably cleaner: if (( c == 50)); then c=0; sleep 60; else ((c++)); fi.

    – chepner
    Mar 7 at 17:52











  • Yes, I want to pause again after another 50 lines. Thank you!

    – user3022917
    Mar 7 at 17:59

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














while read IP
do
<command>

# Sleep
((c++)) && ((c==50)) && sleep 60

done < input_file.txt





share|improve this answer


















  • 1





    You can put the && inside a single ((...)) statement. (( c++ && c == 50)). However, do you want to pause again after another 50 lines? You need to reset the value of c to 0. An explicit if statement is probably cleaner: if (( c == 50)); then c=0; sleep 60; else ((c++)); fi.

    – chepner
    Mar 7 at 17:52











  • Yes, I want to pause again after another 50 lines. Thank you!

    – user3022917
    Mar 7 at 17:59















0














while read IP
do
<command>

# Sleep
((c++)) && ((c==50)) && sleep 60

done < input_file.txt





share|improve this answer


















  • 1





    You can put the && inside a single ((...)) statement. (( c++ && c == 50)). However, do you want to pause again after another 50 lines? You need to reset the value of c to 0. An explicit if statement is probably cleaner: if (( c == 50)); then c=0; sleep 60; else ((c++)); fi.

    – chepner
    Mar 7 at 17:52











  • Yes, I want to pause again after another 50 lines. Thank you!

    – user3022917
    Mar 7 at 17:59













0












0








0







while read IP
do
<command>

# Sleep
((c++)) && ((c==50)) && sleep 60

done < input_file.txt





share|improve this answer













while read IP
do
<command>

# Sleep
((c++)) && ((c==50)) && sleep 60

done < input_file.txt






share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 7 at 17:37









user3022917user3022917

1721215




1721215







  • 1





    You can put the && inside a single ((...)) statement. (( c++ && c == 50)). However, do you want to pause again after another 50 lines? You need to reset the value of c to 0. An explicit if statement is probably cleaner: if (( c == 50)); then c=0; sleep 60; else ((c++)); fi.

    – chepner
    Mar 7 at 17:52











  • Yes, I want to pause again after another 50 lines. Thank you!

    – user3022917
    Mar 7 at 17:59












  • 1





    You can put the && inside a single ((...)) statement. (( c++ && c == 50)). However, do you want to pause again after another 50 lines? You need to reset the value of c to 0. An explicit if statement is probably cleaner: if (( c == 50)); then c=0; sleep 60; else ((c++)); fi.

    – chepner
    Mar 7 at 17:52











  • Yes, I want to pause again after another 50 lines. Thank you!

    – user3022917
    Mar 7 at 17:59







1




1





You can put the && inside a single ((...)) statement. (( c++ && c == 50)). However, do you want to pause again after another 50 lines? You need to reset the value of c to 0. An explicit if statement is probably cleaner: if (( c == 50)); then c=0; sleep 60; else ((c++)); fi.

– chepner
Mar 7 at 17:52





You can put the && inside a single ((...)) statement. (( c++ && c == 50)). However, do you want to pause again after another 50 lines? You need to reset the value of c to 0. An explicit if statement is probably cleaner: if (( c == 50)); then c=0; sleep 60; else ((c++)); fi.

– chepner
Mar 7 at 17:52













Yes, I want to pause again after another 50 lines. Thank you!

– user3022917
Mar 7 at 17:59





Yes, I want to pause again after another 50 lines. Thank you!

– user3022917
Mar 7 at 17:59





Popular posts from this blog

Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme