Gentoo Archives: gentoo-dev

From: Roy Marples <uberlord@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Network configuration and bash
Date: Fri, 09 Feb 2007 10:20:30
Message-Id: 20070209101744.7dc80367@uberlaptop
In Reply to: Re: [gentoo-dev] Network configuration and bash by "Harald van Dijk"
1 On Fri, 9 Feb 2007 10:51:29 +0100
2 Harald van Dijk <truedfx@g.o> wrote:
3 > That works with your ; approach too, as well as with the
4 > newline-separated approach:
5 >
6 > replace="
7 > 4d 1280 768 24
8 > 5c 1400 1050 16
9 > "
10 >
11 > IFS=';
12 > '
13 > #set -f
14 > set -- ${replace}
15 > #set +f
16 > unset IFS
17 >
18 > for x ; do
19 > ....
20 > done
21
22 Yes, but consider this
23
24 iwpriv_ESSID="
25 set AuthMode=WPAPSK;
26 set EncrypType=TKIP;
27 set WPAPSK=yourpasskey
28 "
29
30 One issue is that any valid character is allowed in WPAPSK, including ;
31
32 $ foo="'one '\'' two' \
33 'three ; four' \
34 'five \ six' \
35 "
36 $ eval set -- "${foo}" ; for x in "$@" ; do echo $x; done
37 one ' two
38 three ; four
39 five \ six
40 $
41
42 Demonstrates that we can achieve multi-line arrays like so, without the
43 need to set shell opts or alter IFS
44
45 Thanks
46
47 Roy
48 --
49 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] Network configuration and bash "Harald van Dijk" <truedfx@g.o>