The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
g++ and the -R option eternalflame High Level Programming 0 04-14-2008 02:57 PM
option followed by : taking next option if argument missing with getopts gurukottur Shell Programming and Scripting 2 03-17-2008 12:46 PM
cp - no to all option? td_kuoj3 UNIX for Dummies Questions & Answers 6 08-18-2006 04:57 PM
cc option kuldeep_bora High Level Programming 4 06-02-2006 10:38 AM
cut -f option 435 Gavea UNIX for Dummies Questions & Answers 1 11-10-2003 05:50 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-27-2008
dbsurf dbsurf is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 23
which is best searching option

Hi,

I need one help for choosing best option among sed, perl and awk.
I need to search and replace thousand files for a text and need to replace it. I am in confusion for choosing the option for best results.

Because by using sed option its taking too much time for searching and replacing text in all thousand files. And redirecting the modified files to the same directory.

At present i am using sed for the above.But its taking 2 hrs to replace and redirect the modified files .

Can anyone suggest for choosing best among sed ,perl and awk?
  #2 (permalink)  
Old 01-27-2008
nitin09 nitin09 is offline
Registered User
  
 

Join Date: Jul 2007
Location: India
Posts: 14
i think it will be perl.
  #3 (permalink)  
Old 01-27-2008
Lakris Lakris is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 246
Quote:
Originally Posted by dbsurf View Post
Because by using sed option its taking too much time for searching and replacing text in all thousand files. And redirecting the modified files to the same directory.
Have You tried the -i option for sed? If Your version supports it. It edits the file "in place", it may cut down on time with file handling and piping, depending on how You do it.

/Lakris
  #4 (permalink)  
Old 01-27-2008
KevinADC KevinADC is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2008
Posts: 731
2 hours for thousands of files does not sound bad. And what happened to the suggestions from the other thread? It seems like you're just starting over again with the same question.
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 06:00 PM.


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