I'm writing a nice regex to replace some IP's in a text file.
sed -r "s/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/${APP_IP}/g" /path/to/my/file
However it is giving: sed: -e expression #1, char 49: unterminated 's' command
I need the double quotes otherwise it replaces desired strings with the literal variable name: ${APP_IP}
What am I missing?
SOLVED: Seems to be working when I set the variable $APP_IP manually to the IP under test. If I capture the variable from the output (of a ping) it gives the error. Must be special characters in the variable. Thanks guys.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments