From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21555 invoked by alias); 9 Jul 2010 13:36:25 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15149 Received: (qmail 28797 invoked from network); 9 Jul 2010 13:36:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.214.171 as permitted sender) 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= MIME-Version: 1.0 In-Reply-To: <20100709152718.df78ca73.tartifola@gmail.com> References: <20100709152718.df78ca73.tartifola@gmail.com> From: Guillaume Brunerie Date: Fri, 9 Jul 2010 15:36:00 +0200 Message-ID: Subject: Re: generate series of strings To: tartifola@gmail.com Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=0016e64ca94eb227c0048af47ccc --0016e64ca94eb227c0048af47ccc Content-Type: text/plain; charset=UTF-8 2010/7/9 > > > 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 --0016e64ca94eb227c0048af47ccc--