Visit Jeremy's Blog.
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 01-20-2011, 05:15 PM   #1
Registered: Jan 2003
Distribution: Slackware 14.1
Posts: 273

Rep: Reputation: 32
perl script to parse url from xml URL

Hey guys, I'm trying to simply pull a line (semi-static entry) from an xml file online with a shell script, or perl script.

Basically, I've got a URL that loads an XML file.

From this file I want to pull a text entry:

<blah xml code blah '' blah xml code blah>

I would like to do this from a shell or perl script.

I would like to parse the xml file so that it just pulls the http - .123 information and ends there, that's the only information I need.

it will then run a local command on this file.

bash or perl would be wonderful, if anyone has any premades laying around

Thanks in any case!

Last edited by Freaksta; 01-21-2011 at 02:54 PM. Reason: change preference from bash to bash or perl.
Old 01-20-2011, 07:46 PM   #2
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
Parsing XML is a complicated business. Writing a parser in pure shell script is not going to be easy. You would do better to use Perl or Python IMO.


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
Parse XML to get IP Adresses Only Using Bash arvinarvin Programming 4 07-29-2010 01:56 AM
BASH: Parse XML worm5252 Programming 17 04-01-2010 10:11 AM
How to parse strings in bash script crimson08 Linux - Newbie 17 05-11-2009 11:29 AM
Parse XML in bash script MikeyCarter Linux - Software 1 02-16-2007 01:19 PM
bash script help to parse out text slack guy Linux - Newbie 3 12-30-2004 08:42 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:04 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration