Re: repeat command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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.

-- 
Scott Robbins
PGP keyID EB3467D6
( 1B48 077D 66F6 9DB0 FDC2 A409 FA54 EB34 67D6 )
gpg --keyserver pgp.mit.edu --recv-keys EB3467D6

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos





[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux