The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need Help... to extract the substring dashok.83 Shell Programming and Scripting 4 08-05-2008 04:23 PM
Sed extract substring on (OS X) mlommel Shell Programming and Scripting 3 06-12-2008 07:38 PM
Extract a substring using regular expression apraja Shell Programming and Scripting 2 03-04-2008 05:47 PM
how to extract a substring froma file morena UNIX for Dummies Questions & Answers 1 01-23-2008 07:22 PM
command/script to extract a substring from a string girisha Shell Programming and Scripting 5 09-21-2006 01:30 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 11-22-2008
shellpower shellpower is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 2
Extract a substring.

I have a shell script that uses wget to grab a bunch of html from a url.

URL_DATA=`wget -qO - "$URL1"`


I now have a string $URL_DATA that I need to pull a substring out of..say I had the following in my string

<p><a href="/scooby/929011567.html">Dog pictures check them out! -</a><font size="-1"> (Silly)</font></p> <p><a href="/shaggey/928861647.html">Vacation -</a><font size="-1"> (boating)</font></p> <p><a href="/gopher/928782568.html">Garden -</a><font size="-1"> (winter)</font></p>


I want to extract the URL, Title and Description throughout the string...like the following

/scooby/929011567.html
Dog pictures check them out!
(silly)

/shaggey/928861647.html
Vacation
(boating)

/gopher/928782568.html
Garden
(winter)

and keep going with that pattern as many times as it's in the string. How would I do this?
 

Bookmarks

Tags
shell script, shell scripting, unix scripting, unix scripting basics

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:30 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0