From owner-freebsd-questions@FreeBSD.ORG Sun Dec 12 19:11:16 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 9E0F6106564A for ; Sun, 12 Dec 2010 19:11:16 +0000 (UTC) (envelope-from sterling@camdensoftware.com) Received: from wh2.interactivevillages.com (wh2.interactivevillages.com [75.125.250.34]) by mx1.freebsd.org (Postfix) with ESMTP id 619498FC12 for ; Sun, 12 Dec 2010 19:11:16 +0000 (UTC) Received: from 174-21-106-20.tukw.qwest.net ([174.21.106.20] helo=_HOSTNAME_) by wh2.interactivevillages.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1PRs7u-0006yq-Nf for freebsd-questions@freebsd.org; Sun, 12 Dec 2010 12:02:35 -0800 Received: by _HOSTNAME_ (sSMTP sendmail emulation); Sun, 12 Dec 2010 11:11:10 -0800 Date: Sun, 12 Dec 2010 11:11:10 -0800 From: Chip Camden To: freebsd-questions@freebsd.org Message-ID: <20101212191110.GB97909@libertas.local.camdensoftware.com> Mail-Followup-To: freebsd-questions@freebsd.org References: <20101212120029.9002610657DF@hub.freebsd.org> <709178.44988.qm@web110304.mail.gq1.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wq9mPyueHGvFACwf" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Company: Camden Software Consulting URL: http://camdensoftware.com X-PGP-Key: http://pgp.mit.edu:11371/pks/lookup?search=0xD6DBAF91 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - wh2.interactivevillages.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - camdensoftware.com 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:11:16 -0000 --wq9mPyueHGvFACwf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoth Derrick Ryalls on Sunday, 12 December 2010: > On Sun, Dec 12, 2010 at 9:45 AM, Mark Terribile wr= ote: >=20 > > > > > > It's ok, that i can use this, when i want an incrementing > > > sequence, in a given way: > > > > > > # {START..END..INCREMENT} > > > $ for i in {0..10..2}; do echo "Welcome $i times"; done > > > Welcome 0 times > > > Welcome 2 times > > > Welcome 4 times > > > Welcome 6 times > > > Welcome 8 times > > > Welcome 10 times > > > $ > > > > > > but what's the "magic" for this? : > > > > > > $ MAGIC; do echo "Welcome $i times"; done > > > Welcome 0 times > > > Welcome 1 times > > > Welcome 4 times > > > Welcome 5 times > > > Welcome 8 times > > > Welcome 9 times > > > $ > > > > What's wrong with > > > > for i in 0 1 4 5 8 9 ; do echo "Welcome $i times"; done > > > > ? > > > > Or is there some rule that you want followed? If there is, it's not > > obvious to me. (Sorry.) > > > > Mark Terribile > > > > > > +1, +3, +1, +3.... > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" How about a direct approach: i=3D0;j=3D1 while true;do echo Welcome $i times i=3D`expr $i + $j`;if [ $j -eq 1 ];then;j=3D3;else;j=3D1;fi done Might want to pipe that to more or less. --=20 Sterling (Chip) Camden | sterling@camdensoftware.com | 2048D/3A978E4F http://camdensoftware.com | http://chipstips.com | http://chipsquips= .com --wq9mPyueHGvFACwf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQEcBAEBAgAGBQJNBR5OAAoJEIpckszW26+R2WAH/2GB+wu8Rxi/BzkhXgKpkfZP OzrdNtzR0KkiU5b+/JT5E5lTNuCIMymHQ4TdmD0MEBQU8AiE1AraAO5SXkhzdfj3 hKYtR+Kk27uh65rJvcTYU7SnKBVtC+iEqQ9BNLcT7uAHPyl0NIRZ+9byV2xfPFL3 0m/CYrUkrZxW9qkPSc01aEfCIAzweZgGGrHzbRBV+DraS37w0RMapkaRegGHsam2 upmt7uc/fve/zL4Ca6GGX6XHpCfC01r4P8Hw8N1R5s8l/JTGnj2NA/qRpgMhglfy vqEJoMFvfr1yug0W9kDy7J0RhqiPlqp2whNHwBzE70o3295t3/HgxbU+VarIGig= =1f14 -----END PGP SIGNATURE----- --wq9mPyueHGvFACwf--