sed escape characters issue
by bmxakias from LinuxQuestions.org on (#4W5AW)
Hello
I am trying to to edit a file and change this line:
Code:[ ${NETWORKING} = "no" ] && exit 0to
Code:[ "${NETWORKING}" = "no" ] && exit 0i tried to use \ for some special characters and my command is:
Code:sed -i "s|[ \${NETWORKING} = \"no\" ] && exit 0|[ \"\${NETWORKING}\" = \"no\" ] && exit 0|" /folder/fileBut it doesn't work...


I am trying to to edit a file and change this line:
Code:[ ${NETWORKING} = "no" ] && exit 0to
Code:[ "${NETWORKING}" = "no" ] && exit 0i tried to use \ for some special characters and my command is:
Code:sed -i "s|[ \${NETWORKING} = \"no\" ] && exit 0|[ \"\${NETWORKING}\" = \"no\" ] && exit 0|" /folder/fileBut it doesn't work...