Quantcast
Channel: create XML file using bash script - Unix & Linux Stack Exchange
Browsing latest articles
Browse All 6 View Live

Answer by daitangio for create XML file using bash script

Use in-line document with cat cat >destfile <<EOF <your ZML here...where $vas expand happly> but the rest remain as is EOF I used it in a lot of scripts

View Article



Answer by roaima for create XML file using bash script

Frustratingly perhaps, one of the combinations you omitted would have worked: echo "<root><foo a=\"b\">$lorem</foo><bar value=\"ipsum\" /></root>" >> $MY_XML Single...

View Article

Answer by Romeo Ninov for create XML file using bash script

Print the line on this way: echo '<root><foo a="b">'"$lorem"'</foo><bar value="ipsum" /></root>' >> "$MY_XML" This is need because single quotes deny shell...

View Article

create XML file using bash script

I want create simple xml file using bash script ( not with dom ) but when I set value in the line then echo print the $lorem word and not the val lorem=LOL echo '<root><foo...

View Article

Answer by Kusalananda for create XML file using bash script

The issue is that you are using your variable in a single-quoted string. The shell will never expand variables in single quoted strings.Another issue is that the value in $lorem would not be properly...

View Article


Answer by pmartycz for create XML file using bash script

When you interpolate values into XML template make sure to escape special characters:escape() { local val val=$1 val=${val//&/&amp;} val=${val//</&lt;} val=${val//>/&gt;}...

View Article
Browsing latest articles
Browse All 6 View Live




Latest Images