String Parser
I want to parse a string in a loop
eg A:B:C
E:F:G:H
and put them in different variable
attr1 = A
attr2 = B
attr3 = C
attr4 = D
.
.
/* do processing with attr1, attr2, attr3 and attr4 */
then go to next line E:F:G:H and again assign attr1/attr2/attr3/attr4 with E,F,G and H
Strings I am reding from file line by line. In a line, string can be of any size
for example
A:B:C
E:F:G:H
I:J:K:L:M:N
Therefore after reading a line I want to traverse it till end of line and put strings in different variable depending upon no of strings available in that line(attr1/2/3...)
Could you please guide how should be my bash shell script
|