From owner-freebsd-questions@FreeBSD.ORG Sun Dec 12 19:26:44 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81AC4106564A for ; Sun, 12 Dec 2010 19:26:44 +0000 (UTC) (envelope-from materribile@yahoo.com) Received: from nm24.bullet.mail.sp2.yahoo.com (nm24.bullet.mail.sp2.yahoo.com [98.139.91.94]) by mx1.freebsd.org (Postfix) with SMTP id 5834D8FC12 for ; Sun, 12 Dec 2010 19:26:44 +0000 (UTC) Received: from [98.139.91.61] by nm24.bullet.mail.sp2.yahoo.com with NNFMP; 12 Dec 2010 19:26:44 -0000 Received: from [98.139.91.13] by tm1.bullet.mail.sp2.yahoo.com with NNFMP; 12 Dec 2010 19:26:44 -0000 Received: from [127.0.0.1] by omp1013.mail.sp2.yahoo.com with NNFMP; 12 Dec 2010 19:26:44 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 68024.67302.bm@omp1013.mail.sp2.yahoo.com Received: (qmail 69988 invoked by uid 60001); 12 Dec 2010 19:26:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1292182003; bh=Kv9smi7YBbt9xpoxpPrV3s0G3/yuGPsO8IvjFJRpptk=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=3jrexsFBOKmlqTG/iFOnoKWbwB44OGKOlXY+EZN7MBm/pP2bwjVfTOLm2aWcEZCCVbVhQyZ4nBRG27Q/0kWWkIPLKKAr3BFbwyMIDa68pm7mKBJOL1SBgQuvy/SAtZp12aFsHoeCsGpDQp4lBustwlfKYpBo5Lj7MdUbpDj1Seg= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=VrzAFi0h+asJtcucihcJ9E5u1DUQK8Oj3JgqhnPQ834IKMwwcSljkXTjVIskDWDh8vUARGzPOGWxrJ2at1GjtZk1uUOXawgeWHvtB9vzurbrV0CwBo58h7I4TPzZurZVeetjkTJ5B2tJZiW+2QuqxhGT9UB4WEsSJIPf8OJqKio=; Message-ID: <636022.69287.qm@web110310.mail.gq1.yahoo.com> X-YMail-OSG: atFKUWQVM1mAd.5TvtkJOBxn6lAsW8gAb_CuWiRGqQhAcRI XcCZvObx4M4Q1rj.xCRJ5VpD7t8FZ3MCCuceBeavLvb5R7sGF5X3h46Rt30l Bc6R2A4Um2EQ6ynBNBRRliFeXo7vO4s07TaKGfwEisKc.jGYCSe6CaJnrzlb TgUFnFS2jAhIO5zISFaKNk6Cmv62jp1sOPHXNZDEZEKaRxiogvBQh1T3HluB a1kwSQ0vzI97kNFJhkET8ezSL7ZLd.edB0HstjlCTbdoZg2CYkTjKPpLz_XN .dJFCjfOO4IcmTvLuDJeSluTm1rVYSl9Lveeb7ckpN_CiFKp2oUb4hw.Kxal k08PB6GU6Vx19y8WQTJb4NlK9igsBQMWinyYH71VEMVe0gGh7XrsJs2DCP4W A_2cRGLtSyRX. Received: from [24.228.57.153] by web110310.mail.gq1.yahoo.com via HTTP; Sun, 12 Dec 2010 11:26:43 PST X-Mailer: YahooMailClassic/11.4.20 YahooMailWebService/0.8.107.285259 Date: Sun, 12 Dec 2010 11:26:43 -0800 (PST) From: Mark Terribile To: Derrick Ryalls In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: S Mathias , freebsd-questions@freebsd.org Subject: Re: freebsd-questions Digest, Vol 340, Issue 15 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 19:26:44 -0000 Okay, per private correspondence, here's one that works for the rule (inser= t your own upper limit): (( s =3D -3, d =3D -1 )) ; while (( i =3D ( s +=3D 2 + ( d =3D -d ) ),=A0 i= <=3D 12 )) ; do =A0=A0=A0 echo "Welcome $i times" done Yeah, this needs an explanation in the comments, and it might be tricky to extend to other sequences.=A0 But I think I could do it for most reasonable= ones. --- On Sun, 12/12/10, Derrick Ryalls wrote: From: Derrick Ryalls Subject: Re: freebsd-questions Digest, Vol 340, Issue 15 To: "Mark Terribile" Cc: "S Mathias" , freebsd-questions@freebsd.org Date: Sunday, December 12, 2010, 1:22 PM On Sun, Dec 12, 2010 at 9:45 AM, Mark Terribile wro= te: =0A> =0A> It's ok, that i can use this, when i want an incrementing =0A> sequence, in a given way: =0A> =0A> # {START..END..INCREMENT} =0A> $ for i in {0..10..2}; do echo "Welcome $i times"; done =0A> Welcome 0 times =0A> Welcome 2 times =0A> Welcome 4 times =0A> Welcome 6 times =0A> Welcome 8 times =0A> Welcome 10 times =0A> $ =0A> =0A> but what's the "magic" for this? : =0A> =0A> $ MAGIC; do echo "Welcome $i times"; done =0A> Welcome 0 times =0A> Welcome 1 times =0A> Welcome 4 times =0A> Welcome 5 times =0A> Welcome 8 times =0A> Welcome 9 times =0A> $ =0A =0AWhat's wrong with =0A =0Afor i in 0 1 4 5 8 9 ; do echo "Welcome $i times"; done =0A =0A =A0? =0A =0AOr is there some rule that you want followed? =A0If there is, it's not =0Aobvious to me. =A0(Sorry.) =0A =0A =A0 =A0Mark Terribile =0A =0A +1, +3, +1, +3.... =0A=0A=0A=0A