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?
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.
bash
marked as duplicate by Jonny Henly, Zoe, chepner, tripleee
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.
add a comment |
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.
bash
marked as duplicate by Jonny Henly, Zoe, chepner, tripleee
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
add a comment |
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.
bash
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
bash
asked Mar 7 at 17:12
user3022917user3022917
1721215
1721215
marked as duplicate by Jonny Henly, Zoe, chepner, tripleee
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
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
while read IP
do
<command>
# Sleep
((c++)) && ((c==50)) && sleep 60
done < input_file.txt
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 ofc
to 0. An explicitif
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
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
while read IP
do
<command>
# Sleep
((c++)) && ((c==50)) && sleep 60
done < input_file.txt
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 ofc
to 0. An explicitif
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
add a comment |
while read IP
do
<command>
# Sleep
((c++)) && ((c==50)) && sleep 60
done < input_file.txt
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 ofc
to 0. An explicitif
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
add a comment |
while read IP
do
<command>
# Sleep
((c++)) && ((c==50)) && sleep 60
done < input_file.txt
while read IP
do
<command>
# Sleep
((c++)) && ((c==50)) && sleep 60
done < input_file.txt
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 ofc
to 0. An explicitif
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
add a comment |
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 ofc
to 0. An explicitif
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
add a comment |
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