Sponsored Content
Top Forums Shell Programming and Scripting script to run shell command and insert results to existing xml file Post 80791 by littlejon on Thursday 11th of August 2005 07:26:12 PM
Old 08-11-2005
script to run shell command and insert results to existing xml file

Hi. Thanks for any help with this. I'm not new to programming but I am new to shell programming. I need a script that will

1. execute 'df -k' and return the volume names with specific text
2. surround each line of the above results in opening and closing xml tags
3. insert the results of step #2 into an existing file after a specific opening xml tag.

Any help would be greatly appreciated!

littlejon Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Shell script to append a time for the existing error log file

Hi Guys, the requirement is like this, i am having a error log file in this format, 4594.493: parallel nursery GC 2594592K->2544691K (2969600K), 30.848 ms 4605.958: parallel nursery GC 2634887K->2584986K (2969600K), 38.900 ms 4619.079: parallel nursery GC 2822555K->2774812K... (12 Replies)
Discussion started by: gsprasanna
12 Replies

2. 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

3. Shell Programming and Scripting

how to insert text between lines of an existing file using perl

Hi , I need some inputs on how to open a file (file.txt) and parse the text example aaa of the file and bbb of the file and add the text zzzz once i parse (aaa and bbb) and followed by the remaining of the text as it is in the file using perl programming. Thanks in advance (3 Replies)
Discussion started by: madhul2002
3 Replies

4. Shell Programming and Scripting

insert pipes for existing and non-existing records

I have a source file like this, L4058S462 34329094 F51010141TK1070000483L4058S462 34329094 0232384840 381892 182 5690 L4058S462 34329094 F51020141FIRST CLEARING, LLC A/C 3432-9094 L4058S462 34329094 F51030141JOHAN HOLMQVIST ... (1 Reply)
Discussion started by: saravanamr
1 Replies

5. Shell Programming and Scripting

Insert shell command into first line of output file

How can I insert the command executed on the shell into the first line of my output file? For example if I execute; zcat *.gz |grep “User5501” > users.out How can I make my users.out look like; zcat *.gz |grep “User5501” > users.out User5501 PA User5501 UA User5501 ZA... (3 Replies)
Discussion started by: lewk
3 Replies

6. Shell Programming and Scripting

How to add Xml tags to an existing xml using shell or awk?

Hi , I have a below xml: <ns:Body> <ns:result> <Date Month="June" Day="Monday:/> </ns:result> </ns:Body> i have a lookup abc.txtt text file with below details Month June July August Day Monday Tuesday Wednesday I need a output xml with below tags <ns:Body> <ns:result>... (2 Replies)
Discussion started by: Nevergivup
2 Replies

7. Shell Programming and Scripting

Read xml file till script finds separation and run again for next input and so on

Hi All, I have one query, I managed to run script with user inputs through command line or with 1 file. But I need to read a txt file/xml file in which user can mention multiple sets of answers and script should run for each set till it reach the EOF. Thanks in advance for example, the file... (3 Replies)
Discussion started by: rv_champ
3 Replies

8. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

9. UNIX for Beginners Questions & Answers

Grepping multiple XML tag results from XML file.

I want to write a one line script that outputs the result of multiple xml tags from a XML file. For example I have a XML file which has below XML tags in the file: <EMAIL>***</EMAIL> <CUSTOMER_ID>****</CUSTOMER_ID> <BRANDID>***</BRANDID> Now I want to grep the values of all these specified... (1 Reply)
Discussion started by: shubh752
1 Replies

10. UNIX for Beginners Questions & Answers

How to insert subnode in xml file using xmlstarlet or any other bash command?

I have multiple xml files where i want to update a subnode if the subnode project points to different project or insert a subnode if it doesn't exist using a xmlstarlet or any other command that can be used in a bash script. I have been able to update the subnode project if it doesn't point to... (1 Reply)
Discussion started by: Sekhar419
1 Replies
xmltest(1)						      General Commands Manual							xmltest(1)

NAME
xmltest - Test script to send CIM-XML (via wbemcat) to CIMOM and compare to known results SYNOPSIS
xmltest [FILE] DESCRIPTION
xmltest is a script that is used to send a raw CIM-XML test file to the sfcb CIMOM (using wbemcat) and then compares the returned CIM-XML results against a previously determined 'OK' result file to check whether the returned results match the expected results. If there does not yet exist an 'OK' corresponding to the XML file then xmltest will save the returned results as the new OK file for later use. If the returned CIM-XML results don't match the existing 'OK' file a new 'result' file will be generated containing the erroneous results. If no FILE is specified xmltest will use all files with a .xml extension in the current directory path. EXAMPLE
If there is no 'OK' file to compare returned CIM-XML results against xmltest will generate one. # xmltest test/getclass.Linux_OperatingSystem.xml Running test test/getclass.Linux_OperatingSystem.xml ... OK Saving response as test/getclass.Linux_OperatingSystem.OK If the returned CIM-XML results match the existing 'OK' file xmltest will signal that the test passed. # xmltest test/getclass.Linux_OperatingSystem.xml Running test test/getclass.Linux_OperatingSystem.xml ... Passed If the returned CIM-XML results don't match the existing 'OK' file xmltest will signal that the tes failed and generate a 'result' file containing the erroneous results. # xmltest test/getclass.Linux_OperatingSystem.xml Running test test/getclass.Linux_OperatingSystem.xml ... FAILED Check test/getclass.Linux_OperatingSystem.result for errors PREREQUISITES
Requires wbemcat on search path. AUTHOR
Dr. Gareth S. Bestor <bestor@us.ibm.com> CONTRIBUTORS
Adrian Schuur <schuur@de.ibm.com> BUGS
Does not adequately deal with additional http headers/footers caused by chunking responses, which will result in false failures when com- paring results to existing "x.OK" files. The SBLIM project maintains a mailing list to which you should direct all questions regarding sfcb, sfcc, wbemcli, or any of the SBLIM providers. To subscribe to this mailing list visit http://lists.sourceforge.net/lists/listinfo/sblim-issues The SBLIM Project Bug tracking page can be found at http://sourceforge.net/tracker/?group_id=128809&atid=712784 COPYRIGHT
(C) Copyright IBM Corp. 2004, 2005 AVAILABILITY
The Small-Footprint CIM Broker (sfcb) is a part of the SBLIM project. The most recent version is available on the web at http://sblim.sourceforge.net/ SEE ALSO
wbemcat(1) xmltest Version 1.3.16 August 2005 xmltest(1)
All times are GMT -4. The time now is 01:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy