Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: generate series of strings
- X-seq: zsh-users 15149
- From: Guillaume Brunerie <guillaume.brunerie@xxxxxxxxx>
- To: tartifola@xxxxxxxxx
- Subject: Re: generate series of strings
- Date: Fri, 9 Jul 2010 15:36:00 +0200
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=Z71ZX9ma/z+iwE9onAAq41zXZCrKDt1zhKggXaISb8k=; b=e5e6x+83Pk0KC4TNWOLcV1+lQAEIIFaU3IK4mI4XUr/5V9F2Hke8YYSi4GstgsNdon OVAZUfLmtaC9RYJ4w8aWhndHv/Gdmbt4+FPIn1CqZn3W7hRjbQNZnJDIflkBf8A4uu39 QSJSKfLHJh8qIaicsny32U57JVrkWh0Rv3UoM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=kaPZ/EZEvynpGKon8czfWuIK3E9jknJ7K0givVSeqB5j9d9dmDV+9SgCQF+trrvy8W au1o7JEafbHfz3Pqh6a6LOFmK0CbBEkOoA9z8oYpjWrwvpSoLET01LOnQ5Q8SXKfFhIF YTfuxH1fQ2gVXSL2A+S2B7zds9PvKwOi5A0VA=
- In-reply-to: <20100709152718.df78ca73.tartifola@xxxxxxxxx>
- 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
- References: <20100709152718.df78ca73.tartifola@xxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author