The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Global replace with sed canary Shell Programming and Scripting 5 05-15-2008 07:19 AM
Perl: Global Search and replace epi8 Shell Programming and Scripting 3 05-06-2008 12:18 PM
Perl: Search for string on line then search and replace text Crypto Shell Programming and Scripting 4 01-04-2008 07:24 AM
global replace... topcat8 Shell Programming and Scripting 1 10-16-2005 10:10 PM
global replace with vi pixtond Shell Programming and Scripting 3 06-11-2004 01:54 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-25-2004
alan's Avatar
Registered User
 

Join Date: Jul 2003
Location: Los Angeles
Posts: 53
Global search ok...but replace?

Gurus,

I have in my /tmp directory 26 files "filea", "fileb"..."filez". Each file contains the name of a database 'dwora' at many, many places within each file.

My boss decided to change the name of the db so I need to do (what i'd call) a global search&replace of that string in all my files.

So far, I am able to accomplish the following:
[orcl@dev1]/orcl/tmp/find . -name 'file*' -exec grep dwmora {} \; -exec sed 's/dwora/dworacle/g' {} \;

it outputs to my terminal/screen successfully. However, I want to output my mods in each file from "file*" to "file*.new"....and I can't seem to find the right syntax. I know I can do sed 's/dwora/dworacle/g' filea > filea.new but when I try for multiple files at once, it fails.

What am I missing here?Help, please!


ps: I am running HP-UX dev1 B.11.00 U 9000/800
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:03 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0