Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 11-03-2010, 05:59 AM   #1
LQ Newbie
Registered: Oct 2010
Posts: 9

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

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 name="test2">
Old 11-03-2010, 07:39 AM   #2
Registered: Nov 2008
Location: Lower Saxony, Germany
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731

Rep: Reputation: 137Reputation: 137

do a
man grep
Old 11-03-2010, 07:52 AM   #3
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 985
Blog Entries: 15

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


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


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 07:32 AM
Need assistance with shell script - replace a string with a start tag and end tag SupermanInNY Programming 18 01-02-2010 05:44 PM
Need help writing Unix Shell script to pass file name,path,creation date ! windjashi Programming 4 10-08-2009 12:59 AM
How To get the data from a tag in XML File kingmaker2003 Programming 7 12-04-2008 11:12 PM
LXer: Linux/Unix Shell Script To Find Your Google Page Rank LXer Syndicated Linux News 0 10-28-2008 11:10 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:58 PM.

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