Hi Everyone, I have an sh script that I am working on and I have run into a little snag that I am hoping someone here can assist me with.
I am using wget to retrieve an xml file from thetvdb.com. This part works ok but what I need to be able to do is extract the series ID # from the xml and put the number into a variable for further use in my script.
Here is an example of an xml:
The number in <seriesid>73545</seriesid> is what I am interested in and
in this case I need "73545" extracted and placed into a variable.
How can I accomplish this. I have been able to print out the entire line using grep so it looks like this. But I need just the number.
<seriesid>73545</seriesid>
I haven't been able to figure out sed or awk enough to make this happen. Help?
I have some xml files that got created by exporting a website from RedDot. I would like to extract the cost,
course number, description, and meeting information.
<?xml version="1.0" encoding="UTF-16" standalone="yes" ?>
- <PAG PAG0="3AE6FCFD86D34896A82FCA3B7B76FF90" PAG3="525312"... (3 Replies)
Hello People,
I have the following contents in an XML file
...........
...........
..........
...........
<Details = "Sample Details">
<Name>Bob</Name>
<Age>34</Age>
<Address>CA</Address>
<ContactNumber>1234</ContactNumber>
</Details>
...........
.............
.............. (4 Replies)
Hi,
Within a UNIX shell script I need to extract a value from an XML field. The field will contain different values but will always be 6 digits in length. E.g.:
<provider-id>999999</provider-id>
I've tried various ways but no luck. Any ideas how I might get the provider id (in this case... (2 Replies)
Hi,
In a single line I have the below xml content
<lst name="responseHeader"><int name="status">0</int><int name="QTime">1</int></lst><lst name="status"><lst name=""><str name="name"/><str name="instanceDir">/var/www/search/current/Search/solr/./</str><str... (5 Replies)
Hello All,
I want to write a shell script for extracting a content from a xml file
the xml file looks like this:
<Variable name="moreAxleInfo">
<type>
<Table>
<type>
<NamedType>
<type>
<TypeRef... (11 Replies)
Hi Collegue,
i have a file say a.xml. it has contents
<bpelFault><faultType>1</faultType><genericSystemFault xmlns=""><part name="payload"><v2:Fault... (10 Replies)
I have this XML file format and all in one line:
Fri Dec 23 00:14:52 2016 Logged Message:689|<?xml version="1.0" encoding="UTF-8"?><PORT_RESPONSE><HEADER><ORIGINATOR>XMG</ORIGINATOR><DESTINAT... (16 Replies)
Discussion started by: mrn6430
16 Replies
LEARN ABOUT LINUX
iptables-xml
IPTABLES-XML(8)IPTABLES-XML(8)NAME
iptables-xml -- Convert iptables-save format to XML
SYNOPSIS
iptables-xml [-c] [-v]
DESCRIPTION
iptables-xml is used to convert the output of iptables-save into an easily manipulatable XML format to STDOUT. Use I/O-redirection pro-
vided by your shell to write to a file.
-c, --combine
combine consecutive rules with the same matches but different targets. iptables does not currently support more than one target per
match, so this simulates that by collecting the targets from consecutive iptables rules into one action tag, but only when the rule
matches are identical. Terminating actions like RETURN, DROP, ACCEPT and QUEUE are not combined with subsequent targets.
-v, --verbose
Output xml comments containing the iptables line from which the XML is derived
iptables-xml does a mechanistic conversion to a very expressive xml format; the only semantic considerations are for -g and -j targets in
order to discriminate between <call> <goto> and <nane-of-target> as it helps xml processing scripts if they can tell the difference between
a target like SNAT and another chain.
Some sample output is:
<iptables-rules>
<table name="mangle">
<chain name="PREROUTING" policy="ACCEPT" packet-count="63436" byte-count="7137573">
<rule>
<conditions>
<match>
<p>tcp</p>
</match>
<tcp>
<sport>8443</sport>
</tcp>
</conditions>
<actions>
<call>
<check_ip/>
</call>
<ACCEPT/>
</actions>
</rule>
</chain>
</table> </iptables-rules>
Conversion from XML to iptables-save format may be done using the iptables.xslt script and xsltproc, or a custom program using libxsltproc
or similar; in this fashion:
xsltproc iptables.xslt my-iptables.xml | iptables-restore
BUGS
None known as of iptables-1.3.7 release
AUTHOR
Sam Liddicott <azez@ufomechanic.net>
SEE ALSO iptables-save(8), iptables-restore(8), iptables(8)
Jul 16, 2007 IPTABLES-XML(8)