[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 910
  • Last Modified:

Perl command line search replace word with apostrophe in it

I trying to search and replace using Perl on the command line, not sure how to escape the apostrophe in the command.

ie. Replace Latest's -> Latest
perl -pi -e 's/Latest''s/Latest/g' *.pl <- doesn't work


0
freshgrill
Asked:
freshgrill
1 Solution
 
LevantCommented:
Here is the line that worked for me:

perl -pi.bak -e "s/Latest\'s/Latest/g;" 1.pl

I think you should use \' (backslash ') to escape the apostrophe.

Sincerely,
Boris
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now