Re: [CentOS] repeat command

2013-05-04 Thread Bart Schaefer
On Thu, May 2, 2013 at 2:05 PM, Matt 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; do

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

Re: [CentOS] repeat command

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

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: http://www.melvilleth

Re: [CentOS] repeat command

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

Re: [CentOS] repeat command

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

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 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 portabl

Re: [CentOS] repeat command

2013-05-03 Thread Les Mikesell
On Thu, May 2, 2013 at 6:45 PM, 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 >> n

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 pun

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 fo

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 d

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

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 @serv

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 >>>

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 Les Mikesell
On Thu, May 2, 2013 at 4:16 PM, 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

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/re

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 Descr

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 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

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 CentOS@centos.

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 Paul Norton
Hello Matt try man watch All the best Paul On 2 May 2013 22:05, 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? > __