From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1IlIjP-0002NV-P9 for garchives@archives.gentoo.org; Fri, 26 Oct 2007 06:31:44 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.1/8.14.0) with SMTP id l9Q6UmKf016942; Fri, 26 Oct 2007 06:30:48 GMT Received: from mail.marples.name (rsm.demon.co.uk [80.177.111.50]) by robin.gentoo.org (8.14.1/8.14.0) with ESMTP id l9Q6SqOO014533 for ; Fri, 26 Oct 2007 06:28:52 GMT Received: from [10.73.1.30] (uberpc.marples.name [10.73.1.30]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.marples.name (Postfix) with ESMTP id CEAAB1900FF for ; Fri, 26 Oct 2007 07:28:51 +0100 (BST) Subject: Re: [gentoo-dev] Opinions Wanted - Arrays again :) From: Roy Marples To: gentoo-dev@lists.gentoo.org In-Reply-To: <20071025225641.GK29642@supernova> References: <1193326831.4245.16.camel@uberlaptop.marples.name> <20071025213113.GJ29642@supernova> <1193348959.2910.9.camel@uberpc.marples.name> <20071025225641.GK29642@supernova> Content-Type: text/plain Organization: Gentoo Date: Fri, 26 Oct 2007 07:28:25 +0100 Message-Id: <1193380105.2913.1.camel@uberpc.marples.name> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 6f96b597-3e3b-4770-a015-b81b4e13ec11 X-Archives-Hash: 3679a6422b90b4f375e2141c34a5fe87 On Thu, 2007-10-25 at 15:56 -0700, Donnie Berkholz wrote: > On 22:49 Thu 25 Oct , Roy Marples wrote: > > On Thu, 2007-10-25 at 14:31 -0700, Donnie Berkholz wrote: > > > Is there any way we could avoid these altogether, and instead use > > > separate variables for each array element? > > > > Well, we could prefix with numbers > > > > array="1.2.3.4 netmask 5.6.7.8; > > \* > > 'host.name' netmask 1.2.3.4 > > -I 'option; $FOO with spaces'" > > > > Would become > > > > 0_config_eth0="1.2.3.4 netmask 5.6.7.8;" > > 1_config_eth0="\*" > > 2_config_eth0="'host.name' netmask 1.2.3.4" > > 3_config_eth0="-I 'option; $FOO with spaces'" > > I was hoping for some sort of meaningfully named separate variables, not > an even messier fake array. I'm all ears for any other suggestions :) BTW, my example fails as shell does not allow numbers to prefix variable names. Would have to be something like a0_ a1_ Thanks Roy -- gentoo-dev@gentoo.org mailing list