Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: generate series of strings
- X-seq: zsh-users 15150
- From: tartifola@xxxxxxxxx
- To: zsh-users@xxxxxxx
- Subject: Re: generate series of strings
- Date: Fri, 9 Jul 2010 15:42:46 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:in-reply-to:references:reply-to:organization:x-mailer :mime-version:content-type:content-transfer-encoding; bh=4Y0Axf6OteRTJ+w1QVnbp07/2TNU5BJXzSw6vm+8Mhs=; b=PEPmRqyHmHmLBiwLUDVoiIvLIv178Uq8kWgx/YWTX2j+EqfOuRn8hHVC75Qrpn8nhL qBgPKx5hUQBfHRy7K6gcP7qs4I4aNcF34hcc/MTv+Jnej0MaeQuOQyXVfoljUga2CF8R mVHSHVWUcOWMnpwStPh6Y+r0Ukg/UDiZm4pqI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:reply-to :organization:x-mailer:mime-version:content-type :content-transfer-encoding; b=TQXVUTzgn5vXec1Dajbo4cn63Z+yX18EQ+/fiXzyy6QaC2Uin0gdLhIWAWcXtPdoWn 9bC62bHokAKTZQ1YCppwmNJv6Z3hWeBFSdHhht+rig0N5SX8/7jxpJPj5h1wphIuXhfg ooLGU1xonNHKnmDr3HIAzpxpgizaPIg7trhaE=
- In-reply-to: <AANLkTikjaSGkBzR_aWvhYfFL418ml_x-hbg4qBrzg88w@xxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Tartifola Inc.
- References: <20100709152718.df78ca73.tartifola@xxxxxxxxx> <AANLkTikjaSGkBzR_aWvhYfFL418ml_x-hbg4qBrzg88w@xxxxxxxxxxxxxx>
- Reply-to: tartifola@xxxxxxxxx
On Fri, 9 Jul 2010 15:36:00 +0200
Guillaume Brunerie <guillaume.brunerie@xxxxxxxxx> wrote:
> 2010/7/9 <tartifola@xxxxxxxxx>
>
> >
> >
> > Hi,
> > is there a way to obtain from the command line a series of strings like
> >
> > (1:3) (4:6) (7:9)...
> >
> > always with the same increment. I'm playing with 'seq' and 'sed' but
> > perhaps it's not the best approach.
> > Thanks,
> > A.
> >
>
> Hi,
> You can use a for-loop :
>
> for (( i = 0; i < 5; i++ ))
> do
> echo -n "($(( 3 * i + 1 )):$(( 3 * i + 3))) "
> done
Thanks for your help, it works perfectly. Just a curiosity, any possible solution without a
loop for?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author