UNIX ksh parsing colon delimited string
Posted on 2013-06-10
I have a colon delimited string and I need to split it on the colon delimiter and assign to three different variables. I know there are several ways to do that using ksh scripting but what would be the most efficient way?
My string is "123:45/67/89/321:8765"
As a result I need 3 strings formed, and second string should only consist of the first 3 parts of "45/67/89/321", a.k.a "456789". So the final result should be as follows: str1="123", str2="456789", str3="8765".