The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
Print a portion of file vanand420 UNIX for Dummies Questions & Answers 8 10-19-2008 01:00 AM
Print a portion of a line vanand420 Shell Programming and Scripting 2 10-10-2008 02:23 PM
awk program to select a portion of a line anju Shell Programming and Scripting 3 01-11-2008 06:33 AM
erasing portion of line with sed (only once) gammaman UNIX for Dummies Questions & Answers 1 07-14-2005 08:40 PM
erasing portion of line with sed gammaman UNIX for Dummies Questions & Answers 5 07-10-2005 10:47 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 03-19-2009
islegmar islegmar is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 10
Print portion line in SED

Hi,

This is more a theoretical question, because I usually solved that with perl or even java, but I would like to know if it exists an easy way to do it with SED.

Using regular expresions it's very easy to select an portion line. Does it exist an easy way for printing those portions in SED?

For example, let's suppose that in an HTML file I want to print all links. Selecting the links it's very easy. Just for keeping the things simple, let's suppose the HTML is a well formed one

href=['"]\([^'"]*\)['"]

so \1 holds the link. Now my question, does it exist an easy way in sed for printing all the links?

So, if I have

XXXX href='link1' ZZZ href='link2' XXXX

I want to have

link1
link2


The only way that I know for doing that in sed is deleting everything except the links, but I'm sure it must exist an easier way to do it.

Thanks a lot

Isi
 

Bookmarks

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 11:12 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