We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,183 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

UNIX sed command help

can some body expaly me this command

sed -e 's/<[^>]*>//g' test > test.t

thank you

2
Contributors
2
Replies
16 Hours
Discussion Span
1 Year Ago
Last Updated
3
Views
koricha
Newbie Poster
16 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

It removes html/xml style tags from the input file.

s/      # Search for ...
<       # Something that begins with '<'
[^>]    # and continue while there isn't a '>'
*       # for zero-or more characters
>       # Ending with a '>' character
//      # replace previous match with the empty string
g       # do this globally for each line

This matches (and removes) things like <tag parameter=value> ro <html> .

L7Sqr
Practically a Posting Shark
851 posts since Feb 2011
Reputation Points: 253
Solved Threads: 155
Skill Endorsements: 7

thank you

koricha
Newbie Poster
16 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.5614 seconds using 2.63MB