There is a unix command called repeat.
repeat 10 some_command
Basically repeats some command ten times. Is it available on Centos 6 and what package provides it?
Hello Matt try man watch All the best Paul
On 2 May 2013 22:05, Matt matt.mailinglists@gmail.com wrote:
There is a unix command called repeat.
repeat 10 some_command
Basically repeats some command ten times. Is it available on Centos 6 and what package provides it? _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Hello Matt try man watch All the best Paul
What I am trying to do is:
http://www.redbarn.org/dns/ratelimits
repeat 10 dig @server-ip-address +short +tries=1 +time=1 your-zone.com a
Can I do that with watch?
ok I'd use a script and use sleep
On 2 May 2013 22:26, Matt matt.mailinglists@gmail.com wrote:
Hello Matt try man watch All the best Paul
What I am trying to do is:
http://www.redbarn.org/dns/ratelimits
repeat 10 dig @server-ip-address +short +tries=1 +time=1 your-zone.com a
Can I do that with watch? _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Thu, May 02, 2013 at 04:26:06PM -0500, Matt wrote:
repeat 10 dig @server-ip-address +short +tries=1 +time=1 your-zone.com a
Can I do that with watch?
No. But you can do it with 'seq':
for x in $(seq 1 10); do dig @server-ip-address +short +tries=1 +time=1 your-zone.com a; done
John
On 03.Mai.2013, at 00:01, John R. Dennison wrote:
On Thu, May 02, 2013 at 04:26:06PM -0500, Matt wrote:
repeat 10 dig @server-ip-address +short +tries=1 +time=1 your-zone.com a
Can I do that with watch?
No. But you can do it with 'seq':
for x in $(seq 1 10); do dig @server-ip-address +short +tries=1 +time=1 your-zone.com a; done
this works but at least with bash you can do it with brace expansion for x in {1..10}; do … ; done
it's a bashism but maybe more portable, e.g. OS-X has no seq no fork (for the seq) is necessary as well
On Fri, May 03, 2013 at 01:36:36AM +0200, Markus Falb wrote:
this works but at least with bash you can do it with brace expansion for x in {1..10}; do … ; done
it's a bashism but maybe more portable, e.g. OS-X has no seq no fork (for the seq) is necessary as well
True. Thing I like about seq is that it also takes an optional increment value which can be very handy at times.
John
On 03.Mai.2013, at 01:45, John R. Dennison wrote:
On Fri, May 03, 2013 at 01:36:36AM +0200, Markus Falb wrote:
this works but at least with bash you can do it with brace expansion for x in {1..10}; do … ; done
it's a bashism but maybe more portable, e.g. OS-X has no seq no fork (for the seq) is necessary as well
True. Thing I like about seq is that it also takes an optional increment value which can be very handy at times.
$ echo {1..10..2}
On Fri, May 03, 2013 at 02:03:06AM +0200, Markus Falb wrote:
$ echo {1..10..2}
C6's bash supports this; C5 sadly does not. But thank you for pointing this out to me as I was unaware of this form.
John
On Thu, May 2, 2013 at 6:45 PM, John R. Dennison jrd@gerdesas.com wrote:
On Fri, May 03, 2013 at 01:36:36AM +0200, Markus Falb wrote:
this works but at least with bash you can do it with brace expansion for x in {1..10}; do … ; done
it's a bashism but maybe more portable, e.g. OS-X has no seq no fork (for the seq) is necessary as well
True. Thing I like about seq is that it also takes an optional increment value which can be very handy at times.
Is it _really_ that hard to type the explicit loop with test ([) and expr? These were builtins even in bourne shell eons ago.
-- Les Mikesell lesmikesell@gmail.com
Les Mikesell wrote:
On Thu, May 2, 2013 at 6:45 PM, John R. Dennison jrd@gerdesas.com wrote:
On Fri, May 03, 2013 at 01:36:36AM +0200, Markus Falb wrote:
this works but at least with bash you can do it with brace expansion for x in {1..10}; do … ; done
it's a bashism but maybe more portable, e.g. OS-X has no seq no fork (for the seq) is necessary as well
True. Thing I like about seq is that it also takes an optional increment value which can be very handy at times.
Is it _really_ that hard to type the explicit loop with test ([) and expr? These were builtins even in bourne shell eons ago.
It is not hard. I *tested* what I posted yesterday, and copied and pasted it into my email.
mark
On Fri, May 3, 2013 at 1:23 PM, m.roth@5-cent.us wrote:
True. Thing I like about seq is that it also takes an optional increment value which can be very handy at times.
Is it _really_ that hard to type the explicit loop with test ([) and expr? These were builtins even in bourne shell eons ago.
It is not hard. I *tested* what I posted yesterday, and copied and pasted it into my email.
Sure it worked on the box where you tested it, but I think your version was at least bash-specific and something you'd need to know which version runs where if you use bourne shells anywhere. I'm not good at tracking that stuff, so I like backwards and cross-platform compatibility.
-- Les Mikesell lesmikesell@gmail.com
Les Mikesell wrote:
On Fri, May 3, 2013 at 1:23 PM, m.roth@5-cent.us wrote:
True. Thing I like about seq is that it also takes an optional increment value which can be very handy at times.
Is it _really_ that hard to type the explicit loop with test ([) and expr? These were builtins even in bourne shell eons ago.
It is not hard. I *tested* what I posted yesterday, and copied and pasted it into my email.
Sure it worked on the box where you tested it, but I think your version was at least bash-specific and something you'd need to know which version runs where if you use bourne shells anywhere. I'm not good at tracking that stuff, so I like backwards and cross-platform compatibility.
Oh, sure. Running CentOS 6.4, and yes, I use bash.
mark
On Fri, 3 May 2013 13:02:47 -0500 Les Mikesell wrote:
Is it _really_ that hard to type the explicit loop with test ([) and expr? These were builtins even in bourne shell eons ago.
Here is the simplest possible solution, and exactly what I think the OP was looking for:
http://www.melvilletheatre.com/articles/repeat/
On Fri, May 3, 2013 at 3:52 PM, Frank Cox theatre@melvilletheatre.com wrote:
Is it _really_ that hard to type the explicit loop with test ([) and expr? These were builtins even in bourne shell eons ago.
Here is the simplest possible solution, and exactly what I think the OP was looking for:
Yes, if you think that downloading/installing/maintaining yet another specialized program on every device that might need it is simpler than typing a couple of lines re-using knowledge that's been good for 20+ years.
-- Les Mikesell lesmikesell@gmail.com
On Fri, May 03, 2013 at 01:36:36AM +0200, Markus Falb wrote:
On 03.Mai.2013, at 00:01, John R. Dennison wrote:
On Thu, May 02, 2013 at 04:26:06PM -0500, Matt wrote:
repeat 10 dig @server-ip-address +short +tries=1 +time=1 your-zone.com a
for x in $(seq 1 10); do dig @server-ip-address +short +tries=1 +time=1 your-zone.com a; done
this works but at least with bash you can do it with brace expansion for x in {1..10}; do … ; done
it's a bashism but maybe more portable, e.g. OS-X has no seq no fork (for the seq) is necessary as well
I believe OSX has jot, which is what I used to use with FreeBSD. Fairly similar, and OSX does use bash so the expansion ought to work. Don't have a MAC or BSD box to test right now.
On Thu, May 2, 2013 at 4:16 PM, m.roth@5-cent.us wrote:
Basically repeats some command ten times. Is it available on Centos 6 and what package provides it?
Would never have looked for it - for (( i=-; $i < 10; i++ )); do echo $i;done
I'm even more old-school with bourne syntax: i=0 while [ $i -lt 10 ] do echo $i i=expr `$i + 1` done
Just replace the 'echo $i' whit whatever command you want - or add it on the next line so you can see the iteration count too.
-- Les Mikesell lesmikesell@gmail.com
On May 2, 2013, at 17:34, Michael Mol wrote:
On 05/02/2013 05:05 PM, Matt wrote:
There is a unix command called repeat.
repeat 10 some_command
Basically repeats some command ten times. Is it available on Centos 6 and what package provides it?
# yum whatprovides "*bin/repeat" [snip] No Matches found
I was going to post the same information about finding out with "yum whatprovides". FWIW, repeat is a built-in command in tcsh. Maybe that's where you've seen it before.
Alfred
On 02.Mai.2013, at 23:37, Alfred von Campe wrote:
On May 2, 2013, at 17:34, Michael Mol wrote:
On 05/02/2013 05:05 PM, Matt wrote:
There is a unix command called repeat.
repeat 10 some_command
Basically repeats some command ten times. Is it available on Centos 6 and what package provides it?
# yum whatprovides "*bin/repeat" [snip] No Matches found
I was going to post the same information about finding out with "yum whatprovides". FWIW, repeat is a built-in command in tcsh. Maybe that's where you've seen it before.
You could use that with CentOS
$ csh -c "repeat 10 ..." $ tcsh -c "repeat 10 …"
$ rpm -qf /bin/tcsh tcsh-6.17-24.el6.x86_64
On Thu, May 2, 2013 at 2:05 PM, Matt matt.mailinglists@gmail.com wrote:
There is a unix command called repeat.
repeat 10 some_command
Someone has already mentioned tcsh, but this is also a builtin (syntactic operator like "while" or "for", actually) in zsh.
repeat 10 simple_command repeat 10 do list; of; commands; done repeat 10 { list; of; commands }