1 |
On 07:49 Thu 04 Oct , Roy Marples wrote: |
2 |
> On Thu, 2007-10-04 at 05:03 +0100, Steve Long wrote: |
3 |
> > Donnie Berkholz wrote: |
4 |
> > |
5 |
> > > spec=$(echo ${CHOST} | cut -d- -f3) |
6 |
> > > |
7 |
> > You can do this without resort to an external process: |
8 |
> > IFS=- |
9 |
> > read _ _ spec _ <<< "$CHOST" |
10 |
> > unset IFS |
11 |
> > - or you can do: |
12 |
> > IFS=- |
13 |
> > arr=($CHOST) |
14 |
> > unset IFS |
15 |
> > spec=${arr[2]} |
16 |
> |
17 |
> See, another use of bash arrays just because you can? |
18 |
|
19 |
Sure. If there's no requirement to stick to portable sh, why shouldn't |
20 |
we use whatever features of bash we like? |
21 |
|
22 |
Thanks, |
23 |
Donnie |
24 |
-- |
25 |
gentoo-dev@g.o mailing list |