LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-03-2010, 06:59 AM   #1
hussain.s
LQ Newbie
 
Registered: Oct 2010
Posts: 9

Rep: Reputation: 0
How to find the tag value in xml file through unix shell script


Hi,
the below tag is in the xml file. Now i want to find and extract the value of application name test1 and test2 one by one in the unix shell script. how to do this
<application name="test1">
</application>

<application name="test2">
</application>
 
Old 11-03-2010, 08:39 AM   #2
mesiol
Member
 
Registered: Nov 2008
Location: Lower Saxony, Germany
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731

Rep: Reputation: 137Reputation: 137
Hi,

do a
Code:
man grep
.
 
Old 11-03-2010, 08:52 AM   #3
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 978
Blog Entries: 14

Rep: Reputation: 135Reputation: 135
grep and sed should do the job (sed to get rid of double quotes).

but if you want a more advanced XML parsing script, then awk is your friend

Serafean

Last edited by serafean; 11-03-2010 at 08:59 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unix shell script:How to delete the first line in a file?? rche3252 Programming 6 03-03-2010 08:32 AM
Need assistance with shell script - replace a string with a start tag and end tag SupermanInNY Programming 18 01-02-2010 06:44 PM
Need help writing Unix Shell script to pass file name,path,creation date ! windjashi Programming 4 10-08-2009 01:59 AM
How To get the data from a tag in XML File kingmaker2003 Programming 7 12-05-2008 12:12 AM
LXer: Linux/Unix Shell Script To Find Your Google Page Rank LXer Syndicated Linux News 0 10-28-2008 12:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration