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

Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

Posting a File and Associated Data to a RESTful WebService preferably as JSON2019 Community Moderator ElectionREST URI convention - Singular or plural name of resource while creating itUploading both data and files in one form using Ajax?How do I upload a file with metadata using a REST web service?REST API - file (ie images) processing - best practicesSpring: JSON data and file in the same requestREST API Put large dataPosting a file and JSON data to Spring rest serviceRESTful Web Service Upload/Download Large Data With JSONREST API Design sending JSON data and a file to the api in same requestPost JSONArray to REST servicePUT vs. POST in RESTParsing values from a JSON file?JavaScript/jQuery to download file via POST with JSON dataHow do I upload a file with metadata using a REST web service?How to POST JSON data with Curl from Terminal/Commandline to Test Spring REST?Separate REST JSON API server and client?what's the correct way to send a file from REST web service to client?How do I write JSON data to a file?What is “406-Not Acceptable Response” in HTTP?REST API - file (ie images) processing - best practices

How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page