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 1Il5Sv-00039Y-0h for garchives@archives.gentoo.org; Thu, 25 Oct 2007 16:21:49 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.1/8.14.0) with SMTP id l9PGKtiK022146; Thu, 25 Oct 2007 16:20:55 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 l9PGIkwg019371 for ; Thu, 25 Oct 2007 16:18:46 GMT Received: from [10.73.1.31] (uberlaptop.marples.name [10.73.1.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.marples.name (Postfix) with ESMTP id 587A1190100 for ; Thu, 25 Oct 2007 17:18:46 +0100 (BST) Subject: Re: [gentoo-dev] Opinions Wanted - Arrays again :) From: Roy Marples To: gentoo-dev@lists.gentoo.org In-Reply-To: <4720BE02.6080409@gentoo.org> References: <1193326831.4245.16.camel@uberlaptop.marples.name> <4720BE02.6080409@gentoo.org> Content-Type: text/plain Organization: Gentoo Date: Thu, 25 Oct 2007 17:18:42 +0100 Message-Id: <1193329122.4245.25.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 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 7223806b-5ec2-4f3b-9b7e-8bfb84da8c51 X-Archives-Hash: 3c421dd01e6077e3cd9e1420b818304d On Thu, 2007-10-25 at 18:02 +0200, Marijn Schouten (hkBst) wrote: > These sh ``arrays'' are really just strings, right? Did you implement > functions to take them apart? Can the same function handle forms 1 and 3? I don't think we could use both. Here's a code snippet of actually using them # How baselayout-2 presently handles arrays eval "$(_get_array array)" for x in "$@"; do echo "$x" done # How baselayout-2 may handle arrays based on this discussion IFS=" " for x in $(_get_array array); do unset IFS echo "$x" done Assume that the _get_array function correctly maps the bash array to the posix shell one in both cases. Thanks Roy -- gentoo-dev@gentoo.org mailing list