[ale] Thanks - and another Bash script question
Michael D. Hirsch
mhirsch at nubridges.com
Thu May 15 11:35:51 EDT 2003
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
More information about the Ale
mailing list