I have a problem similar to the one solve in this question: How do I split a string on a delimiter in Bash? .
The real difference is that I'm targeting the sh
and ksh
shell so, for example, I can't use the <<<
redirection.
To recap my problem I have the content of a variable that is
VALUES="
val1 ;val2 ;val3
another1;another2;another3
"
so clearly the whitespace and
;
are the characters that I would like to get rid of.
I also have to use this values as they appear in a 3 by 3 basis, 3 at the time, but I assume that for that I can simply use $1
,$2
and $3
after the expansion plus a shift 3
at the end of each cycle.
Thanks.