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, 05: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 06:24 AM.
Old 11-18-2011, 10: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: 7,043
Blog Entries: 14

Rep: Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213
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 03:55 PM
how to replace with variable using sed? babag Programming 4 09-17-2008 04:28 PM
How do I replace ' with sed.... @ngelot Linux - Newbie 2 11-02-2007 08:04 PM
SED - replace / insert furquan Programming 5 03-01-2006 07:58 PM
problem in perl replace command with slash (/) in search/replace string ramesh_ps1 Red Hat 4 09-10-2003 02:04 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:59 AM.

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