From ilug-admin@linux.ie  Mon Aug 19 11:02:47 2002
Return-Path: <ilug-admin@linux.ie>
Delivered-To: yyyy@localhost.netnoteinc.com
Received: from localhost (localhost [127.0.0.1])
	by phobos.labs.netnoteinc.com (Postfix) with ESMTP id CB0FC44196
	for <jm@localhost>; Mon, 19 Aug 2002 05:54:24 -0400 (EDT)
Received: from phobos [127.0.0.1]
	by localhost with IMAP (fetchmail-5.9.0)
	for jm@localhost (single-drop); Mon, 19 Aug 2002 10:54:24 +0100 (IST)
Received: from lugh.tuatha.org (root@lugh.tuatha.org [194.125.145.45]) by
    dogma.slashnull.org (8.11.6/8.11.6) with ESMTP id g7HL8j610834 for
    <jm-ilug@jmason.org>; Sat, 17 Aug 2002 22:08:45 +0100
Received: from lugh (root@localhost [127.0.0.1]) by lugh.tuatha.org
    (8.9.3/8.9.3) with ESMTP id WAA08700; Sat, 17 Aug 2002 22:07:20 +0100
Received: from hawk.dcu.ie (mail.dcu.ie [136.206.1.5]) by lugh.tuatha.org
    (8.9.3/8.9.3) with ESMTP id WAA08664 for <ilug@linux.ie>; Sat,
    17 Aug 2002 22:07:12 +0100
X-Authentication-Warning: lugh.tuatha.org: Host mail.dcu.ie [136.206.1.5]
    claimed to be hawk.dcu.ie
Received: from prodigy.redbrick.dcu.ie (136.206.15.10) by hawk.dcu.ie
    (6.0.040) id 3D36BB4A000AD875 for ilug@linux.ie; Sat, 17 Aug 2002 22:07:12
    +0100
Received: by prodigy.redbrick.dcu.ie (Postfix, from userid 1023) id
    97F48DA4A; Sat, 17 Aug 2002 22:07:11 +0100 (IST)
Date: Sat, 17 Aug 2002 22:07:11 +0100
From: Philip Reynolds <phil@redbrick.dcu.ie>
To: ilug@linux.ie
Subject: Re: [ILUG] expanding a string multiple times
Message-Id: <20020817220711.H29114@prodigy.Redbrick.DCU.IE>
References: <3D5D27B9.9080009@corvil.com>
    <20020817100644.GA29167@chewie.compsoc.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <20020817100644.GA29167@chewie.compsoc.com>; from
    kor@compsoc.com on Sat, Aug 17, 2002 at 11:06:44AM +0100
Sender: ilug-admin@linux.ie
Errors-To: ilug-admin@linux.ie
X-Mailman-Version: 1.1
Precedence: bulk
List-Id: Irish Linux Users' Group <ilug.linux.ie>
X-Beenthere: ilug@linux.ie

Kevin O' Riordan's [kor@compsoc.com] 30 lines of wisdom included:
> 
> On Pungenday, the 9th day of Bureaucracy, Padraig Brady confessed:
> > How can I repeat a string an arbitrary number
> > of times in bash/sed/...
> >
> > I.E. I'm missing the repeat in the following:
> >
> > STRING="> "
> > NUMBER=3
> > PREFIX=repeat $STRING $NUMBER
> > echo $PREFIX
> > > > >
> 
> 
> perl ?
> 
>   STRING="> "
>   NUMBER=3
>   PREFIX=`perl -e "print '$STRING' x $NUMBER;"`
>   echo $PREFIX
> 
> I'm pretty sure the bsd 'jot' utility can do this too, but I don't
> have it to hand.

I didn't think that jot was installed on Linux systems by default,
so from the tone of Padraigs mail that's not what he wanted,
however, if I'm incorrect (don't have a Linux system to hand) the
following is the syntax.

jot -b "string" 3

Phil.
-- 
  Philip Reynolds        
   RFC Networks          tel: 01 8832063
www.rfc-networks.ie      fax: 01 8832041

-- 
Irish Linux Users' Group: ilug@linux.ie
http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
List maintainer: listmaster@linux.ie

