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
Remove html tags with bash dejavu88 Shell Programming and Scripting 4 05-22-2008 01:58 PM
How to supplement HTML tags with SED DocBrewer Shell Programming and Scripting 3 04-25-2008 09:40 AM
html tags dunryc Shell Programming and Scripting 3 11-29-2007 06:14 PM
Automated replacement of HTML Tags nem_kirk SUN Solaris 1 11-17-2005 01:24 AM
unsing sed to strip html tags - help zap Shell Programming and Scripting 3 04-18-2004 04:03 AM

Closed Thread
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
  #1 (permalink)  
Old 03-14-2008
rev66 rev66 is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 3
removing html tags via parameter expansion

Hi all-

I have a variable that contains a web page:

echo $STUFF

<html> <head> <title>my page</title></head> <body> blah blah
etc..

Can I use the shell's parameter expansion abilities to remove just the tags?
I thought that FIXHTML=${STUFF//<*>/} might do it, but it didn't seem to work.

Do I need to escape the < and > or something like that?

Thanks!!

-Rev66
  #2 (permalink)  
Old 03-14-2008
Tytalus's Avatar
Tytalus Tytalus is offline Forum Advisor  
echo {1..9}^2\;|bc
  
 

Join Date: Jun 2003
Location: Scotland
Posts: 431
depending on exact content, this should mostly work:

Code:
#  echo $STUFF | sed 's/<[^>]*>//g'
  my page  blah blah
  #3 (permalink)  
Old 03-14-2008
rev66 rev66 is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 3
Quote:
Originally Posted by Tytalus View Post
depending on exact content, this should mostly work:

Code:
#  echo $STUFF | sed 's/<[^>]*>//g'
  my page  blah blah
I had considered doing that exact thing, but I'd really like to avoid the additional process if possible by doing it in the shell...
Closed Thread

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 12:04 PM.


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