The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 03-26-2007
dennis.jacob dennis.jacob is offline
dj -------
 

Join Date: Feb 2007
Location: Cochin/Bangalore, India
Posts: 380
Quote:
Originally Posted by vino
Your expression is not valid. sed requires an expression of the format
Code:
"s/pattern/replacement/global_flag"
You have "s/pattern/global_flag". Also the single quote will disable parameter expansion.

No Vino...You are wrong.As you said in your previous post that we can take advantage of the pattern of "p1/w1" here....
So I just used it here... It works well for me..

Here, Every $each stands for "p1/w1" , "p2/w2" etc....
sed 's/'$each'/g' $2
So in effect, it will be
sed 's/p1/w1/g $2

Last edited by dennis.jacob; 03-26-2007 at 01:23 AM.
Reply With Quote