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.

The first is much more readable than the last, but only slightly more
readable than the middle one. I'm not a sh/bash guru the way many of the
developers are, and I can tell you right up front that I'd be more
comfortable configuring options if they looked more like the first
example, and I'd guess many users would feel the same way. The fewer " '
; \ characters there are to keep track of, the better.


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to