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 at 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 at centos.org > http://lists.centos.org/mailman/listinfo/centos >-- * "I know one thing: That I know nothing"* - Socrates *"We're all explorers here"* - T S Eliot
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
> Hello Matt > try man watch > All the best PaulWhat 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?
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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 555 bytes Desc: OpenPGP digital signature URL: <http://lists.centos.org/pipermail/centos/attachments/20130502/f5df425b/attachment-0002.sig>
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 foundI 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
> repeat 10 some_commandFound this on the web somewhere: #!/bin/sh i=0 num=$1 shift while [ $(( i += 1 )) -le $num ]; do eval "$@" done Worked fine. Thanks.
On Thu, May 2, 2013 at 2:05 PM, Matt <matt.mailinglists at gmail.com> wrote:> There is a unix command called repeat. > > repeat 10 some_commandSomeone 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 }