Code:
line='Owner: C=US, O="Some Content, Inc.", OU=ABCDE12345, CN="Some Distribution: Some Content, Inc. (ABCDE12345)", UID=ABCDE12345'
Single quotes are not part of the string. The closest I could get is:
Code:
IFS="," read -ra splitted string <<< "$line"
The problem is that IFS does not tolerate double quotes and splits like:
${splitted[2]} == "O=Some Content"
${splitted[3]} == "Inc."
Ideally I would like to get a result like:
[0] Owner
[1] C=US
[2] O=Some Content, Inc.
[3] OU=ABCDE12345
[4] CN=Some Distribution: Some Content, Inc. (ABCDE12345)
[5] UID=ABCDE12345
I looked at awk and sed, and both cuts through the quoted line. Is there any idea / help on how to do it in just with standard shell tools? I have perl and python on this box too, just very unsure about syntax.
Thanks a lot