Hi,
I've a string "this.is.a.name", and I would like to put it in an array.
But, I've like to print the output of the array as:
Code:
echo ${array[0]}
echo ${array[1]}
echo ${array[2]}
echo ${array[3]}
I've tried with
Code:
STR="this.is.a.name";
arr=$(echo $STR | tr "." " ");
echo ${array[0]}
echo ${array[1]}
echo ${array[2]}
echo ${array[3]}
but only the first position contains the phrase "this is a name". The rest of the array is empty.
I've searched over the manuals and the web, and I couldn't find a solution for my case.
How can I do that?
Thanks,