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
Use double quotes instead of single quotes, or close the quotes just before the variable and reopen them just after.
sed -i "/$pc/ s/off/on/" sed -i '/'$pc'/ s/off/on/'
This will let bash perform the variable evaluation normally.