1,105,386 Community Members

UNIX sed command help

Member Avatar
koricha
Newbie Poster
15 posts since Feb 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

can some body expaly me this command

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

thank you

Member Avatar
L7Sqr
Veteran Poster
1,006 posts since Feb 2011
Reputation Points: 179 [?]
Q&As Helped to Solve: 168 [?]
Skill Endorsements: 11 [?]
 
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> .

Member Avatar
koricha
Newbie Poster
15 posts since Feb 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

thank you

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: