We help IT Professionals succeed at work.

escape single qouta in sed

Amin El-Zein
Amin El-Zein asked
on
110 Views
Last Modified: 2020-04-03
Hello,
I have a file contain:
strtolower($g['sss'])
I want to chabge it to
strtolower(ffff)
I try with :
sed -I.original 's/strtolower($g\['''sss'''\])/strtolower(fff)/g;' myfile
but its not work I want to escap the single quota.
thanks.
Comment
Watch Question

ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015

Commented:
sed -i.original 's/strtolower($g\['"'sss'\])/strtolower(fff)/g;" myfile
or
sed -i.original "s/strtolower(\$g\['sss'\])/strtolower(fff)/g;" myfile
Application Development and Automation Management
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
@Gerwin Jansen and all

Thank you :) (for me to follow the same).
Proceed as per given comments.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.