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 -->
  #5 (permalink)  
Old 03-26-2007
vino's Avatar
vino vino is offline
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,643
Quote:
Originally Posted by jacoden
Try this out.......

Code:
for each in $(echo $1 | tr  ','  ' ' )
do
 sed 's/'$each'/g'  $2 >temp
 mv temp $2
done
cp $2 $3
Your regex expression is not valid. For regex, 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.
Reply With Quote