The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Parentheses in perl find/replace
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Parentheses in perl find/replace
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
1
(
permalink
)
08-19-2007
Jeffish
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?
Jeffish
View Public Profile
Find all posts by Jeffish
Find Jeffish's past nominations received
Find Jeffish's present nominations given