From: | Roy Marples <uberlord@g.o> | ||
---|---|---|---|
To: | gentoo-dev@l.g.o | ||
Subject: | Re: [gentoo-dev] Opinions Wanted - Arrays again :) | ||
Date: | Fri, 26 Oct 2007 11:33:32 | ||
Message-Id: | 1193398245.4312.24.camel@uberlaptop.marples.name | ||
In Reply to: | Re: [gentoo-dev] Opinions Wanted - Arrays again :) by Roy Marples |
1 | On Thu, 2007-10-25 at 17:18 +0100, Roy Marples wrote: |
2 | > # How baselayout-2 may handle arrays based on this discussion |
3 | > IFS=" |
4 | > " |
5 | > for x in $(_get_array array); do |
6 | > unset IFS |
7 | > echo "$x" |
8 | > done |
9 | |
10 | Also, if we didn't need to actually set any variables outside the loop |
11 | we could also then write this |
12 | |
13 | _get_array array | while read x; do |
14 | echo "$x" |
15 | done |
16 | |
17 | Thanks |
18 | |
19 | Roy |
20 | |
21 | -- |
22 | gentoo-dev@g.o mailing list |