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 1IlAL8-0008F5-OD for garchives@archives.gentoo.org; Thu, 25 Oct 2007 21:34:07 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.1/8.14.0) with SMTP id l9PLX9qa024281; Thu, 25 Oct 2007 21:33:09 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by robin.gentoo.org (8.14.1/8.14.0) with ESMTP id l9PLVF7L021966 for ; Thu, 25 Oct 2007 21:31:15 GMT Received: from gentoo.org (c-67-171-150-177.hsd1.or.comcast.net [67.171.150.177]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 4A9F7656C7 for ; Thu, 25 Oct 2007 21:31:15 +0000 (UTC) Date: Thu, 25 Oct 2007 14:31:13 -0700 From: Donnie Berkholz To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] Opinions Wanted - Arrays again :) Message-ID: <20071025213113.GJ29642@supernova> References: <1193326831.4245.16.camel@uberlaptop.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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1193326831.4245.16.camel@uberlaptop.marples.name> User-Agent: Mutt/1.5.16 (2007-06-09) X-Archives-Salt: 3bfe9171-7e26-4621-9b1e-cc24c9b683f0 X-Archives-Hash: 6dc68bf17a0787d254b4191a4bfd6d6f On 16:40 Thu 25 Oct , Roy Marples wrote: > Hello List > > It's your favourite posix shell lover here, asking for your honest > opinions. > > array="1.2.3.4 netmask 5.6.7.8; > \* > 'host.name' netmask 1.2.3.4 > -I 'option; $FOO with spaces' > " > > array=("1.2.3.4 netmask 5.6.7.8;" > "\*" > "'host.name' netmask 1.2.3.4" > "-I 'option; $FOO with spaces'" > ) > > array="'1.2.3.4 netmask 5.6.7.8;' \ > '\*' \ > \"'host.name' netmask 1.2.3.4\" \ > \"-I 'option; $FOO with spaces'\" > " > > The first and last are of course posix constructs whilst the middle is > bash. > > The bash one is purely there for reference, and of course you can still > use it if /bin/sh is bash. The last one is what baselayout-2 currently > uses and I'm wondering if we should switch to the first one before we > come out of package.mask. > > I'm asking which you think are the most readable of the first and last > ones and if you see any issues with either. Is there any way we could avoid these altogether, and instead use separate variables for each array element? Thanks, Donnie -- gentoo-dev@gentoo.org mailing list