Now i want to store each of these value seperated by comma to a array and access each of the values. Also find out number of such values seperated by comma.
Variable1 can have any number of values seperated by comma.
thanks for the reply. I tried this code as an example beore applying the same logic in my work. It worked fine.
But when i incorporated the same logic in my work, it is throwing syntax error saying that unexpected (. it will not throw me error if i either remove () from declare -a Arr=($Variable1); or if i delete this line.
I cannot share my code due to privilege issues. Kindly guide me how to trouble shoot this issue.
The code snippet by anbu23 is working fine. I guess that sth in the context (some lines up/down) has been messed up. Please post those lines, eventually hiding/modifying classified portions.