On 15.09.2012 11:31, ice wrote:
> hi!
>
> which of the following 2 methods is better?
None. ;-)
> list1=AAA#B#CCCCC#D#E#F#GG
>
> 1.
> IFS=# read -r -a array1 <<< "$list1"
>
> 2.
> array1=($(echo $list1|awk -F\# '{for (i=1; i<=NF; i++) printf "%s ",$i}'))
>
> thanks
>
$ list1=AAA#B#CCCCC#D#E#F#GG
$ IFS=# array=($list1)
$ echo ${array[2]}
CCCCC