Sponsored Content
Top Forums Shell Programming and Scripting parsing data from xml file is failing can't open variable Post 302424920 by juanb25 on Wednesday 26th of May 2010 03:04:52 PM
Old 05-26-2010
error parsing data from xml file into variable

Created a korn shell script, everything is is working except this section, the variable $SYSINFO is being set, but the NASIP & NASDEV are failing, it appears to be treating the config.xml file config directory and xml as the file. Need a second set of eyes to tell me where I am messing up.

Code:
# Start NAS Interface Config
SYSINFO="/vm/$zonename/root/var/sysinfo"
echo $SYSINFO
NASIP="`/bin/sed -n -e 's/.*<nasip>\(.*\)<\/nasip>.*/\1/p' $SYSINFO/config.xml`"
NASDEV="`/bin/sed -n -e 's/.*<nasdevice>\(.*\)<\/nasdevice>.*/\1/p' $SYSINFO/config.xml`"
echo $NASDEV
zonecfg -z $zonename 'add net; set address=$NASIP; set physical=$NASDEV;end'

This is the output from this section of the script.

Code:
/vm/server04z1/root/var/sysinfo    ----> echo $SYSINFO
Can't open /vm/server04z1/root/var/sysinfo/config  ---> should be parsing config.xml
Can't open xml
Can't open /vm/server04z1/root/var/sysinfo/config   ---> should be parsing config.xml
Can't open xml


Last edited by jim mcnamara; 05-26-2010 at 08:02 PM.. Reason: Code tags, please...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Parsing XML dynamic data via awk?

I am trying to use a line of output in an XML file as input in another new XML file for processing purposes via a shell script. Since I am a newbie though, I'm not sure how to do this since the data is different everytime. I am using this technique with static data right now: echo -n "Running... (5 Replies)
Discussion started by: corwin43
5 Replies

2. Shell Programming and Scripting

Parsing data and retaining the full length of variable

Here's is an example of what I want to do: var1="Horse " var2="Cat " var3="Fish " for animals in "$var1" "$var2" "$var3" do set $animals pet=$1 ## Ok, now I want to get the values of $pet, but ## I want to retain the full length it was... (3 Replies)
Discussion started by: app4dxh
3 Replies

3. Shell Programming and Scripting

Parsing and getting data from XML file using ksh script

Hi All, I have a xml file for example as described below <xml> <address> <street><street> <address/> <isbn>426728783932020308393930303</isbn> <book> <name> </name> </book> . . . </xml> My problem is to get the isbn number from the above described file using ksh script. Could... (6 Replies)
Discussion started by: vinna
6 Replies

4. Shell Programming and Scripting

Parsing posted XML data from a remote server?

Hi Is it possible to parse a posted xml data from a remote server in unix shell script. if so how to do that? and i need to give this script path in the push url (in remote server) . how to do this? I have tried this in asp but could not succeed....so am trying in shell scripting...the thread... (1 Reply)
Discussion started by: aemunathan
1 Replies

5. Shell Programming and Scripting

XML parsing with a variable

I have the following XML <Audit_Type>1</Audit_Type><Session_Id>34505863</Session_Id> <StatementId>1</StatementId><EntryId>1</EntryId> <Extended_Timestamp>2012-03-06T10:25:20.789459</Extended_Timestamp> <DB_User>KASINIY</DB_User> <OS_User>majohn1</OS_User><OS_Process>28636</OS_Process>... (3 Replies)
Discussion started by: BeefStu
3 Replies

6. Shell Programming and Scripting

Help - Parsing data in XML in Linux

Hi, I have an XML file in Linux and it contains a long string of characters. The last part of the file is like ....... ....... ....... CAD</MarketDescription></InvestorTransaction></AdvisorAccount></DivisionAdvisor></Division>... (3 Replies)
Discussion started by: naveed
3 Replies

7. Shell Programming and Scripting

XML: parsing of the Google contacts XML file

I am trying to parse the XML Google contact file using tools like xmllint and I even dived into the XSL Style Sheets using xsltproc but I get nowhere. I can not supply any sample file as it contains private data but you can download your own contacts using this script: #!/bin/sh # imports... (9 Replies)
Discussion started by: ripat
9 Replies

8. Shell Programming and Scripting

Parsing XML (and insert data) then output data (bash / Solaris)

Hi folks I have a script I wrote that basically parses a bunch of config and xml files works out were to add in the new content then spits out the data into a new file. It all works - apart from the xml and config file format in the new file with XML files the original XML (that ends up in... (2 Replies)
Discussion started by: dfinch
2 Replies

9. Shell Programming and Scripting

Help with parsing xml file

Hi, Need help with parsing xml data in unix and place it in a csv file. My xml file looks like this: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <iwgroups> <nextid value="128"> </nextid> <iwgroup name="RXapproval" id="124" display-name="RXapproval"... (11 Replies)
Discussion started by: ajayakunuri
11 Replies

10. Shell Programming and Scripting

Parsing custom data into xml in Shell

Hi , I have data as below in a text file { 'AAA' => { 'A1' => 'a1 comment', 'A2' => 'a2 comment' }, 'BBB' => { 'B1' => 'b1 comment' }, 'CCC' => { 'C1' => 'c1 comment', 'C2' => 'c2 comment', 'C3' => 'c3 comment' 'C4' => 'c4... (2 Replies)
Discussion started by: vivek d r
2 Replies
DRADIO-CONFIG(1)						  DRadio Manuals						  DRADIO-CONFIG(1)

NAME
dradio-config - generate dradio configuration SYNOPSIS
dradio-config [--rss] DESCRIPTION
dradio-config is a script to help keep the dradio menu list configuration ~/.config/dradio/menu.xml up-to-date. It relies on curl, tidy, and xsltproc to screen scrape the DR streams and podcasts pages, and outputs the resulting XML on stdout. Invoke it as, e.g. dradio-config > radio.xml dradio-config --rss > podcast.xml FILES
~/.config/dradio/menu.xml The menu configuration file. See dradio(5) for further details. http://www.dr.dk/netradio/wmp.asp DR netradio direct links page. http://www.dr.dk/Podcast DR podcast direct links page. AUTHOR
Jess Thrysoee <jess@thrysoee.dk> SEE ALSO
dradio(5), dradio(1), curl(1) tidy(1) xsltproc(1) DRadio AUGUST 2009 DRADIO-CONFIG(1)
All times are GMT -4. The time now is 10:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy