how can I use a variable as a pattern finder for sed? for example:
sed -i '/$pc/ s/off/on/' ~/Documents/Mantenimiento
I know there is a $ in between the ” but there gotta be a way! please help!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use double quotes instead of single quotes, or close the quotes just before the variable and reopen them just after.
This will let bash perform the variable evaluation normally.