From owner-freebsd-questions Tue Jul 9 12: 4:56 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0903A37B400 for ; Tue, 9 Jul 2002 12:04:55 -0700 (PDT) Received: from kanga.honeypot.net (kanga.honeypot.net [208.162.254.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F36343E3B for ; Tue, 9 Jul 2002 12:04:54 -0700 (PDT) (envelope-from kirk@strauser.com) Received: from pooh.int (mail@pooh.int [10.0.1.2]) by kanga.honeypot.net (8.12.5/8.12.5) with ESMTP id g69J4lvq053684 for ; Tue, 9 Jul 2002 14:04:47 -0500 (CDT) (envelope-from kirk@strauser.com) Received: from kirk by pooh.int with local (Exim 3.35 #1 (Debian)) id 17S0I3-0002Nq-00 for ; Tue, 09 Jul 2002 14:04:47 -0500 To: freebsd-questions@freebsd.org Subject: Re: How do I repeat a command N times? References: <003101c22768$80ddb250$0801a8c0@customfilmeffects.com> <20020709200449.3fcf1ba7.fxn@retemail.es> From: Kirk Strauser Date: 09 Jul 2002 14:04:47 -0500 In-Reply-To: <20020709200449.3fcf1ba7.fxn@retemail.es> Message-ID: <8765zowwmo.fsf@pooh.int> Lines: 20 X-Mailer: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 2002-07-09T18:04:49Z, "F.Xavier Noria" writes: > With a Perl one-liner: > > $ perl -e '$n = 607; system "cmd" while $n--' Mix and match! If you know Bash or sh much better than Perl, just use Perl to feed the counter: for i in `perl -e 'print ".\n"x10;'`; do echo 'foo'; done Replace 'x10' with 'x607' and "echo 'foo'" with whatever complicated shell command you've strung together and you'll have the best of both worlds (or worst, depending on your POV). -- Kirk Strauser The Strauser Group - http://www.strausergroup.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message