I have a configuration file which contains a line like :
I'm trying to write a script that will use sed to replace the URL information.
By using :
EXISTING_URL=`cat filename | grep URL | cut -d= -f2`
I can see what the existing setting is, by using
cat filename | sed "s/$EXISTING_URL/$NEW_URL/" >new_filename
fails however as sed wants all "/" chars shown as "\/" so it knows not to treat them as it's usual delimiters.
so now I'm stuck as I can't work out how to amend this on the fly