Passing values to an XML file from shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Passing values to an XML file from shell script
# 1  
Old 11-18-2014
Passing values to an XML file from shell script

Smilie Hi,

I have an XML file with 5 tags. I need to pass values to the XML file from a shell script that will replace values in 2 of the tags. I cannot hardcode the tag values in XML and use replace command in script as the values are likely to change.
Please help !!!!!!!!!!!
# 2  
Old 11-18-2014
It will be good if we get an example input and expecting output for your issue.

Last edited by penqueen; 11-18-2014 at 10:15 AM.. Reason: grammar
# 3  
Old 11-19-2014
I have 2 variables a and b . a=12345 and b=8976.
In the XML there are 2 tags suppose:
<xyz>111</xyz>
<uio>222</uio>
Now , I want to pass value of 'a' i.e. '12345' to XML tag <xyz> and replace '111' by '12345'. Again value of 'b' i.e. '8976' will be passed to XML tag <uio> and '222' will be replaced by '8976'.
How to do this in 1 go ?
Hope i have made myself clear !!!!!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract values from xml file script

Hi, please help on this. I want extract values of xml file structure and print in determined way. <ProjectName> --> only appears once <StructList> --> is the top node <Struct> node --> could be more than 1 NameID, STX, STY, PRX, PRY --> appears only 1 time within each <Struct> node... (10 Replies)
Discussion started by: Ophiuchus
10 Replies

2. Shell Programming and Scripting

Getting error while including values in xml tags using shell script

Hi All, Please find the code below where I want to add the variable value in between the XML tags. I am taking one string and my goal is to put them between the xml tags. Ex : in between <name> , <lname> Kindly suggest a correction because while executing this script I am getting and... (8 Replies)
Discussion started by: rajneesh4U
8 Replies

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

4. Shell Programming and Scripting

Passing PERL var values to SH Shell Script

Greetings all, If I have a SH script that calls a PERL script in the following way: perl $HOME/scripts/config.properties And in the config.properties PERL file, this Perl script only sets a number of environmental parameters in the following way: #!/usr/bin/perl $VAR1 = ( ... (3 Replies)
Discussion started by: gikyo12
3 Replies

5. Shell Programming and Scripting

passing values to the shell script

Hi, Solaris : 10 . I have 3 database in single file system i.e. /d01 . whenever I connect to oracle user using the below method #su - oracle It will prompt for which database environment you want to set(PROD,TEST,UAT) : whichever i need i will enter required DATABASE and perform my... (2 Replies)
Discussion started by: maooah
2 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

passing values from sql to shell script

Hi guyz, Posting a thread after a long time. I want to pass two variables to unix shell script from sql script. Note: I am calling sql script from unix script. sql script has 2 variables one is the return code for status of program run and second one email flag. I don't know how to capture... (3 Replies)
Discussion started by: sachin.gangadha
3 Replies

8. Shell Programming and Scripting

Passing Values from a shell script

Hi all I want to know how to pass value from one shell script to another suppose i have script named A.This 'A.sh' calls 'B.sh' .Now some calculations are done by B.sh ..Say in variable X. Now i want to pass the value of this X variable to 'A.sh'... A.sh ----> B.sh ( X variable ) ... (6 Replies)
Discussion started by: dhananjaysk
6 Replies

9. Programming

Passing Parameters and getting values back from a c program to Shell script

I am having a shell script which has to be called from a C program. I have to pass two parameters to this script. HOw can I do that? eg: int main() { char st1; char str2; // call a shell script call_sh(str1,str2) where call_sh is the name of the shell script. then i need to get the return... (5 Replies)
Discussion started by: Rajeshsu
5 Replies
Login or Register to Ask a Question