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
$? means? mathur UNIX for Dummies Questions & Answers 2 11-03-2008 07:36 AM
sigempty what means? Puntino UNIX for Dummies Questions & Answers 1 04-28-2008 08:44 AM
what it means? rraajjiibb UNIX for Dummies Questions & Answers 4 08-31-2004 01:36 PM
What does ##* means yeheyaansari UNIX for Advanced & Expert Users 2 02-14-2002 09:39 AM
what is means by tar xvr - E-Quality UNIX for Dummies Questions & Answers 2 09-24-2001 09:48 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-22-2008
samarn samarn is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 1
Can anyone tell me what this means..???

I found a file in my base folder width the name replace.sh and width the text string.

sed -i "s/$1/$2/g" `grep -ir $1 ./*|grep -v '.svn'|cut -d: -f1`

Wat does it mean and what does it do?
  #2 (permalink)  
Old 11-23-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
This takes two parameters $1 is the old value of word, $2 is the new value.
The code searches every file in the directory for the old string, if it finds the string in the file and the filename does not end in .svn - then it displays the whole file on the screen with the old word replaced by the new word.
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 03:49 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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