- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script help
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2003 09:41 AM
03-04-2003 09:41 AM
I have a script I am using and it works fine unless the html tag runs across multiple lines....ie
How do I make the statement link the lines so it thinks it is all one, or to continue afte finding the first < until it finds the second > and delete that and all in between? To get it to work on one line, I am using
sed "s/<[^>]*>/ /g"
it works great. Just not when multiple lines are involved. Please help!
Solved! Go to Solution.
- Tags:
- sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2003 09:48 AM
03-04-2003 09:48 AM
Re: Script help
Did you try deletion like this.
sed '/\/d' data
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2003 09:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2003 10:02 AM
03-04-2003 10:02 AM
Re: Script help
When I try the second script, it does remove the
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2003 10:03 AM
03-04-2003 10:03 AM
Re: Script help
When I try the second script, it does remove the
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2003 10:15 AM
03-04-2003 10:15 AM
Re: Script help
# cat test|sed -e :a -e 's/<[^>]*>//g;/You sure it's not typo ..?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2003 11:03 AM
03-04-2003 11:03 AM
Re: Script help
[/tmp] # cat kmv_test| /tmp/html_kmv2
a:hover { color: #990000; text-decoration: none }
a:visited { color: navy }
a:visited:hover{ color: #990000; text-decoration: none } -->
[/tmp] # cat kmv_test
[/tmp] # cat /tmp/html_kmv2
#!/bin/ksh
while read line
do
echo $line |sed -e :a -e 's/<[^>]*>//g;/done
#
exit 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2003 11:10 AM
03-04-2003 11:10 AM
Re: Script help
I missed your idea.
Credit goes to Chan and his script does work.
The problem with your approach is that you are applying it to each line by the 'while' statement which will not work.
You have to apply the sed statement to the entire file at once.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2003 11:12 AM
03-04-2003 11:12 AM
Re: Script help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2003 11:20 AM
03-04-2003 11:20 AM
Re: Script help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2003 11:35 AM
03-04-2003 11:35 AM
Re: Script help
# ./myscript datafile > new-datafile
The "myscript" script ..
#!/bin/ksh
[[ $# != 1 ]] && { echo "Usage: $0
cat $1|sed -e :a -e 's/<[^>]*>//g;/