0

I've seen some suggestions to use eval, but that assumes the quoted text is an entire string in itself, and not part of one.

Simple example:

Split the string

<SERVICETYPE Name="Two words">

So that we get

<SERVICETYPE
Name="Two words">

Is this possible? Ideally in a statement that I can then use to loop through the values. (Yes, I know perl or something would be easier, but I don't have anything more useful than bash availale, so I have to get this working).

I'm currently splitting into an array with the following

IFS=" " read -ra xmlfield <<< ${xmlline}
for i in "${xmlfield[@]}"; do

But then of course that gives me:

<SERVICETYPE
Name="Two 
words">

Which is a pain.

michjnich
  • 2,796
  • 3
  • 15
  • 31

0 Answers0