[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] Thanks - and another Bash script question



On Thursday 15 May 2003 11:27 am, Bob Kruger wrote:
> My thanks to all who assisted.  I should have been more specific - I did
> have access to some of the basic Unix commands.  The solutions provided
> were adequate.
>
> I have one more question concerning arrays.  I know that if I do the
> following:
>
> cn=(This is a test)
>
> then $cn[1] = "This" , $cn[2] = "is", etc...
> And to see them I would "echo {$cn[1]}"
>
> If I have a line with comma based delimiters, how would I read that into
> an array, e.g.
>
> ct={This,is,a,test)
>
> and have $ct[1] = "This" , $ct[2] = "is" , etc?

man tr

Or just read the previous solutions that used tr.  They should tell you all 
you need to convert the commas to spaces, thus reducing the problem to the 
first case.

Michael
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale