From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11976 invoked by alias); 9 Jul 2010 13:43:01 -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: 15150 Received: (qmail 13193 invoked from network); 9 Jul 2010 13:42:51 -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,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.161.43 as permitted sender) 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= Date: Fri, 9 Jul 2010 15:42:46 +0200 From: tartifola@gmail.com To: zsh-users@zsh.org Subject: Re: generate series of strings Message-Id: <20100709154246.2f2fe276.tartifola@gmail.com> In-Reply-To: References: <20100709152718.df78ca73.tartifola@gmail.com> Reply-To: tartifola@gmail.com Organization: Tartifola Inc. X-Mailer: Sylpheed 3.0.2 (GTK+ 2.18.9; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 9 Jul 2010 15:36:00 +0200 Guillaume Brunerie wrote: > 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 Thanks for your help, it works perfectly. Just a curiosity, any possible solution without a loop for?