Gentoo Archives: gentoo-dev

From: "Marijn Schouten (hkBst)" <hkBst@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Opinions Wanted - Arrays again :)
Date: Thu, 25 Oct 2007 16:05:23
Message-Id: 4720BE02.6080409@gentoo.org
In Reply to: [gentoo-dev] Opinions Wanted - Arrays again :) by Roy Marples
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Roy Marples wrote:
5 > Hello List
6 >
7 > It's your favourite posix shell lover here, asking for your honest
8 > opinions.
9 >
10 > array="1.2.3.4 netmask 5.6.7.8;
11 > \*
12 > 'host.name' netmask 1.2.3.4
13 > -I 'option; $FOO with spaces'
14 > "
15 >
16 > array=("1.2.3.4 netmask 5.6.7.8;"
17 > "\*"
18 > "'host.name' netmask 1.2.3.4"
19 > "-I 'option; $FOO with spaces'"
20 > )
21 >
22 > array="'1.2.3.4 netmask 5.6.7.8;' \
23 > '\*' \
24 > \"'host.name' netmask 1.2.3.4\" \
25 > \"-I 'option; $FOO with spaces'\"
26 > "
27 >
28 > The first and last are of course posix constructs whilst the middle is
29 > bash.
30 >
31 > The bash one is purely there for reference, and of course you can still
32 > use it if /bin/sh is bash. The last one is what baselayout-2 currently
33 > uses and I'm wondering if we should switch to the first one before we
34 > come out of package.mask.
35 >
36 > I'm asking which you think are the most readable of the first and last
37 > ones and if you see any issues with either.
38
39 These sh ``arrays'' are really just strings, right? Did you implement
40 functions to take them apart? Can the same function handle forms 1 and 3?
41
42 Marijn
43
44 - --
45 Marijn Schouten (hkBst), Gentoo Lisp project
46 <http://www.gentoo.org/proj/en/lisp/>, #gentoo-lisp on FreeNode
47 -----BEGIN PGP SIGNATURE-----
48 Version: GnuPG v2.0.7 (GNU/Linux)
49 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
50
51 iD8DBQFHIL4Bp/VmCx0OL2wRAszVAJ9gKSxDq+D4QlppCw+vHzKtCTq5DQCfUa0m
52 lxNxzVbipBXBcPL+6G2vGyY=
53 =bBAt
54 -----END PGP SIGNATURE-----
55 --
56 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] Opinions Wanted - Arrays again :) Roy Marples <uberlord@g.o>