Re: [CentOS] repeat command

2013-05-04 Thread Bart Schaefer
On Thu, May 2, 2013 at 2:05 PM, Matt matt.mailingli...@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

Re: [CentOS] repeat command

2013-05-03 Thread Les Mikesell
On Thu, May 2, 2013 at 6:45 PM, John R. Dennison j...@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

Re: [CentOS] repeat command

2013-05-03 Thread m . roth
Les Mikesell wrote: On Thu, May 2, 2013 at 6:45 PM, John R. Dennison j...@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

Re: [CentOS] repeat command

2013-05-03 Thread Les Mikesell
On Fri, May 3, 2013 at 1:23 PM, m.r...@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

Re: [CentOS] repeat command

2013-05-03 Thread m . roth
Les Mikesell wrote: On Fri, May 3, 2013 at 1:23 PM, m.r...@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

Re: [CentOS] repeat command

2013-05-03 Thread Frank Cox
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:

Re: [CentOS] repeat command

2013-05-03 Thread Les Mikesell
On Fri, May 3, 2013 at 3:52 PM, Frank Cox thea...@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

Re: [CentOS] repeat command

2013-05-03 Thread Matt
repeat 10 some_command Found this on the web somewhere: #!/bin/sh i=0 num=$1 shift while [ $(( i += 1 )) -le $num ]; do eval $@ done Worked fine. Thanks. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos

[CentOS] repeat command

2013-05-02 Thread Matt
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

Re: [CentOS] repeat command

2013-05-02 Thread Paul Norton
Hello Matt try man watch All the best Paul On 2 May 2013 22:05, Matt matt.mailingli...@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?

Re: [CentOS] repeat command

2013-05-02 Thread m . roth
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? Would never have looked for it - for (( i=-; $i 10; i++ )); do echo $i;done mark

Re: [CentOS] repeat command

2013-05-02 Thread Matt
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

Re: [CentOS] repeat command

2013-05-02 Thread Paul Norton
ok I'd use a script and use sleep On 2 May 2013 22:26, Matt matt.mailingli...@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

Re: [CentOS] repeat command

2013-05-02 Thread Michael Mol
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 HTH signature.asc Description:

Re: [CentOS] repeat command

2013-05-02 Thread Alfred von Campe
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]

Re: [CentOS] repeat command

2013-05-02 Thread Les Mikesell
On Thu, May 2, 2013 at 4:16 PM, m.r...@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 [

Re: [CentOS] repeat command

2013-05-02 Thread John R. Dennison
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

Re: [CentOS] repeat command

2013-05-02 Thread Markus Falb
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

Re: [CentOS] repeat command

2013-05-02 Thread Markus Falb
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

Re: [CentOS] repeat command

2013-05-02 Thread John R. Dennison
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

Re: [CentOS] repeat command

2013-05-02 Thread Scott Robbins
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

Re: [CentOS] repeat command

2013-05-02 Thread Markus Falb
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

Re: [CentOS] repeat command

2013-05-02 Thread John R. Dennison
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 -- Failure is not the only