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 the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 08-19-2007
Jeffish Jeffish is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 4
Parentheses in perl find/replace

I'm trying to use the following command to do a batch find and replace in all commonly named files through a file hierarchy


Code:
find . -name 'file' |xargs perl -pi -e 's/find/replace/g'

which works fine except for a substitution involving parenthesis.

As a specific example I'm trying to sub "G(d)" with "G('d,'p)."

The interpreter seems to just ignore the parentheses and not finding the string "Gd" simply does nothing. I can't just find/replace "d" as the character appears throughout the file.

Any help?