Sponsored Content
Top Forums Shell Programming and Scripting reading xml attributes with shell script Post 302319739 by swetha123 on Tuesday 26th of May 2009 05:26:56 AM
Old 05-26-2009
Bug reading xml attributes with shell script

Hi,

Iam new to shell scripting.I have below urgent requirement

I want to read attributes (transaction,documentmode) in xml tag with shell scripting and create a filename with these attribues

Xml :
<PURCHASE_10 partner="food" version="1.50" timestamp="2009-03-10T09:56:55" transaction="PURCHASEORDER" document_mode="abc">
</PURCHASE_10>

output : PURCHASEORDER_abc.xml

Ur help is appreciated

Thanks.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

reading and searching xml element text in script

well i have this xml file here: this file is called filereader.xml <?xml version="1.0" encoding="UTF-8"?> <file> <file1> <filecopy>thefile.txt</filecopy> <filecopy>thefile2.ppt</filecopy> </file1> </file> hi..i got this problem....hmm how do i write a... (6 Replies)
Discussion started by: forevercalz
6 Replies

2. Shell Programming and Scripting

reading and searching xml element text in script

well i have this xml file here: this file is called filereader.xml <?xml version="1.0" encoding="UTF-8"?> <file> <file1> <filecopy>/new/test/thefile.txt</filecopy> <filecopy>/new/test/thefile2.ppt</filecopy> </file1> </file> i need to write the script that search for the Bold text... (2 Replies)
Discussion started by: forevercalz
2 Replies

3. Shell Programming and Scripting

Reading a table in a shell script

Dear all: I want to write a script capable of reading specific rows and collumns of a table, into a variable. Just imagine i have a file named table.dat which contains: GENERAL INFORMATION Col 1 Col2 Col3 1 1 2 2 3 3 4 4 What i want to do... (13 Replies)
Discussion started by: luiscarvalheiro
13 Replies

4. Shell Programming and Scripting

reading XML datas via Shell Script

Hi all, i have an xml file with this fomat(exactly) : <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE TestSuite SYSTEM "../../CallCrt.dtd"> <TestSuite description="Diameter"> <FileReference FileName="DMI_FC01.xml"/> <!--<FileReference FileName="DMI_FC02.xml"/> -->... (1 Reply)
Discussion started by: freepal
1 Replies

5. Shell Programming and Scripting

file reading through shell script

For reading a file through shell script I am using yhe code : while read line do echo $line done<data.txt It reads all the line of that file data.txt. Content of data.txt looks like: code=y sql=y total no of sql files=4 a.sql b.sql c.sql d.sql cpp=n c=y total no of c files=1 (4 Replies)
Discussion started by: Dip
4 Replies

6. Shell Programming and Scripting

How to remove xml namespace from xml file using shell script?

I have an xml file: <AutoData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Table1> <Data1 10 </Data1> <Data2 20 </Data2> <Data3 40 </Data3> <Table1> </AutoData> and I have to remove the portion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" only. I tried using sed... (10 Replies)
Discussion started by: Gary1978
10 Replies

7. Shell Programming and Scripting

reading from stdin in a shell script

Hello, I've managed to get my .procmailrc file to work. At least it triggers a script which creates a file. But the file is empty. How do I get at the data that's been piped? I've done much creative googling to no avail. I belive it should be in stdin, but I can't figure out how to access... (4 Replies)
Discussion started by: mmesford
4 Replies

8. Shell Programming and Scripting

Reading xml tags from ksh script

Hi, I have an XMl file, below is sample: <TRANSFORMATION DESCRIPTION ="Created by:- " NAME ="LKP_FT_T_FILEK" OBJECTVERSION ="1" REUSABLE ="YES" TYPE ="Lookup Procedure" VERSIONNUMBER ="1"> </TRANSFORMATION> I need to read the tag, and if the tag is TRANSORMATION, i want to check the Type... (6 Replies)
Discussion started by: kedar_laveti
6 Replies

9. UNIX for Dummies Questions & Answers

Reading XML file and print the values in the text file using Linux shell script

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (1 Reply)
Discussion started by: sravanreddy
1 Replies
IVMCONFIGPROPERTIES.XML(5)					File Formats Manual					IVMCONFIGPROPERTIES.XML(5)

NAME
IvmConfigProperties.xml - device properties to be monitored by ivman(8) DESCRIPTION
IvmConfigProperties.xml specifies hardware properties to be monitored by ivman(8), and allows running of certain commands when device prop- erties change. IvmConfigProperties.xml is parsed as an XML file. The general form of the file is: <?xml version="1.0" encoding="UTF-8"?> <ivm:PropertiesConfig version="0.1" xmlns:ivm="http://www.eikke.com/ivm"> <ivm:Match name="matchname" value="matchvalue"> <ivm:Property name="propertyname"> <ivm:Action value="propertyvalue1" exec="command1" /> <ivm:Action value="propertyvalue2" exec="command2" /> ... </ivm:Property> </ivm:Match> ... </ivm:PropertiesConfig> Each time a property changes on a device, this file will be parsed. If the Match rule matches the device on which the property changed, and the Property rule matches the name of the property which changed, then all of the Action rules within that Property tag wil be parsed. If 'value' is equal to the new value of the changed property, then the command specified in 'exec' will be executed. A Match element can have any of the following names: ivm.mountable Whether or not HAL specifies that a device can and should be mounted. Must be "true" or "false". hal.anything The string in place of "anything" will be taken as the name of a HAL property string for the device, and the value of the prop- erty will be compared to the value given. Run 'lshal' to see a list of HAL properties which can be used here. * Match every device. Use with care! As many Matches can be nested as is desired. A Property element can have the following name: hal.anything The string in place of "anything" will be taken as the name of a HAL property string for the device, and if this is the prop- erty that has changed, enclosed rules will be processed. An Action element can have any string as its 'value'. If the new value of the changed property is equal to this string, then the command given as the 'exec' property will be executed. It can also have the special value '*'; in this case, the 'exec' command will be executed every time the property changes. exec supports substitution of HAL device properties. This is accomplished by surrounding the property name with $ symbols. For instance, if $hal.volume.mount_point$ is within a command, it will be replaced with the volume's mount point before execution. No character escaping is done in the substitution, but the characters ' and " are replaced with ?, so you can surround the substitution with quotes without fear. There is also a single Option which can be set in this file, and should be set outside of any Match or Property blocks. The syntax of this option is: <ivm:Option name="checkOnInit" value="true" /> If the value of checkOnInit is true, then Ivman will check every device on the system for matching rules when started. For example, if a rule was present which started a service only when a particular volume was mounted, and Ivman was started when the volume was already mounted, it would start the service if and only if checkOnInit was set to true. Remember that this is an XML file, which means that characters which have a special meaning in XML (entities) need to be escaped. Some characters which are popular in shell scripting (&, <, >) are among these special characters. As a quick reference, & becomes &amp; , < becomes &lt; , > becomes &gt; , ' becomes &apos; and " becomes &quot; . SEE ALSO
ivman(8), IvmConfigBase.xml(5), IvmConfigActions.xml(5), IvmConfigConditions.xml(5) 12 May 2005 IVMCONFIGPROPERTIES.XML(5)
All times are GMT -4. The time now is 07:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy