Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-18-2011, 04:59 AM   #1
Registered: Dec 2009
Posts: 41

Rep: Reputation: 15
Red face Sed replace Help replace for (<a>

I am trying to replace
(<a href="" target="_blank">Google</a>)
with sed. I did the following and it did not work for some reason -

find /home/tst -type f -exec sed -i "s#(<a href="" target="_blank">Google</a>)#Google#g" {} \;
any idea where I went wrong?

Sorry I figured it out. Mods can delete the thread.

find /home/tst -type f -exec sed -i 's#(<a href="" target="_blank">Google</a>)##g' {} \;

Last edited by guessity; 11-18-2011 at 05:24 AM.
Old 11-18-2011, 09:05 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,945
Blog Entries: 14

Rep: Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163
Mods won't delete the thread because it contains a solution. It helps others with the same question to find it later.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Using File as Replace in Sed abercrombieande Programming 9 03-04-2011 02:55 PM
how to replace with variable using sed? babag Programming 4 09-17-2008 03:28 PM
How do I replace ' with sed.... @ngelot Linux - Newbie 2 11-02-2007 07:04 PM
SED - replace / insert furquan Programming 5 03-01-2006 06:58 PM
problem in perl replace command with slash (/) in search/replace string ramesh_ps1 Red Hat 4 09-10-2003 01:04 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:30 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration