The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
Perl: Search for string on line then search and replace text Crypto Shell Programming and Scripting 4 01-04-2008 10:24 AM
Need to search and replace in multiple files in directory hierarchy umen Shell Programming and Scripting 3 12-24-2007 04:56 AM
Multiple search in multiple files maxvirrozeito Shell Programming and Scripting 2 12-13-2007 01:32 PM
multiple input search and replace script tungaw2004 UNIX for Dummies Questions & Answers 3 04-29-2007 07:59 AM
sed search and replace d__browne UNIX for Dummies Questions & Answers 7 04-26-2006 09:46 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-21-2007
tungaw2004 tungaw2004 is offline
Registered User
  
 

Join Date: Feb 2007
Posts: 31
Multiple search and replace

Hi,

I have different files and I want to automatically change the values of the defined variables. i want to get rid of editing all the files and make it a little bit faster. my problem is like this.

1. i will input all the new values.
2. substitute this values into the values inside the file.

thanks.
  #2 (permalink)  
Old 03-22-2007
yogi_raj_143 yogi_raj_143 is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 16
You can use sed script for this

sed script would contains
s/Search1/Replace1
s/Search2/Replace2
s/Search3/Replace3
s/Search4/Replace4

now you can use this script (TCSH) as
foreach f (`cat fileList`)
sed -f SedScript $f
end
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:57 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0